Thread: Main.obj : error LNK2019:

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    118

    Main.obj : error LNK2019:

    Hi i get this error when i try to build this code the error is:

    Main.obj : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "bool __cdecl Game_Main(void)" (?Game_Main@@YA_NXZ)

    im reasonably new to c++ and the code is not mine i managed to get rid of most of the other errors but this one has foxed me?

    i have investigated this error and found that most solutions involve linking the winmm.lib file i have that file linked(at least i think i do in the directx platformsdk
    and with microsoftsdk

    so maybe an explanation of what the error accually is would be very helpful as then i can learn from my mistake but i would also appreciate a solution to my problem please
    thanks in advance

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Why are you doing a game when you're a beginner? Link against winmm.lib.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    118
    im a very quick learner and the game im working with was premade by someone else they inclued the exe for the game but not the files to link to.

    i have linked to winmm
    here is my link which i think goes to winmm.lib

    c:\microsoft platform sdk for windows server 2003 r2\lib
    although it may be in this one?
    c:\microsoft sdks\windows\v6.0a\lib

    if this is incorrect could you please post for me the path i need to include?

    thanks again

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Either one is fine (though the newer, the better - so link to 2003 if you can).
    A game may be too advanced, even if you are a fast learner. Start with basics then work your way up; there's a reason why we do this.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Dec 2005
    Posts
    118
    sorry when i say im new i mean i have read a book on c++
    then i read a tutorial on sdl and made a game from that.
    (ok it wasnt the best game but it played as i wanted it to)
    and i have read lots of tutorials and articles since then i have good belief in my abbility to code the games that im making.

    so in essence by new i mean im not experienced with c++ and this being someone elses code mean that they have set the paths up(but i also dont really know which paths are correct)

    also this code im using appears to use both opengl and directx. both of which i have never used before. the code is for a simple pong game which i will break down to see how they work and develop my version of that pong game.

    i dont have advanced skills in using c++ but i have more than a basic understanding of programming in genral(or perhaps i mean the concepts of programming) thanks again for your help.

    ok i have them both linked but still recieve that same error?

    where should i change the link path?
    i have tried doing it in: tools->options->projects and soloutions->vc++directories.

    sorry i forgot to add im using visualc++ express 2008

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No, you can't be linking with winmm.lib.
    It's under Linker -> Input (or General?) I believe. Additional includes field.
    I'm not home so I can't have a look. But you could look into help for where to specify libraries to link with.
    The path you specify is where you put the paths where the compiler and linker will search for files.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    118
    ahhh so thats where i been going wrong
    thanks for your help i appreciate it
    i will try to sort that linker out now.

    edit:you truely are the master thank you for helping me
    it works now
    Last edited by thestien; 12-18-2007 at 05:43 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Weird Namespace error..
    By Nebbuchadnezzar in forum C++ Programming
    Replies: 10
    Last Post: 05-12-2006, 11:53 PM
  2. Linker errors...
    By MipZhaP in forum Game Programming
    Replies: 2
    Last Post: 08-27-2004, 09:12 AM
  3. the effects of textures on my frame rate
    By DavidP in forum Game Programming
    Replies: 37
    Last Post: 10-03-2003, 11:24 AM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM
  5. Unresolved external symbols in OGL
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 08-04-2002, 09:46 PM