Linking problems

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Linking problems

      I am a novice programmer, and this is my first time using the Visual C++ 2005 Express Edition environment - so please forgive my ignorance. I am having trouble linking the libraries, and getting a whole bunch of LNK 2019 errors. Could someone familiar with this environment give me a rundown of the settings for the library directories and such? I have read the read me files, but am still unable to identify the problem.

      - Thanks
    • RE: Linking problems

      There really is only one error, repeating about 140 times. They all refer to an unresolved external symbols:

      dxutd.lib(DXUTmisc.obj) : error LNK2019: unresolved external symbol __imp__GetForegroundWindow@0 referenced in function "public: __thiscall CD3DArcBall::CD3DArcBall(void)" (??0CD3DArcBall@@QAE@XZ)
      dxerr9.lib(dxerr9.obj) : error LNK2001: unresolved external symbol __imp__GetForegroundWindow@0
      dxutd.lib(DXUTmisc.obj) : error LNK2019: unresolved external symbol __imp__SetCursorPos@8 referenced in function "protected: void __thiscall CBaseCamera::UpdateMouseDelta(float)" (?UpdateMouseDelta@CBaseCamera@@IAEXM@Z)

      Here is a short sampling. The whole log can be viewed attached. I think I just have my library paths screwed up, but I am not sure...
    • RE: Linking problems

      Basically, these errors are telling you that the linker can't find the body of those functions. This is almost always a result of forgetting to set up your linker paths and/or to explicitly link the LIB files you need.

      I can't recall off-hand where those functions are defined, but you should only have to add the libs to your project settings. You could always do a search for the function prototypes and figure out what library they're defined if it's not apparent.

      You set up libs in Projects -> Properties -> Linker -> Input -> Additional Dependencies

      If you still have trouble, I'll dig through the source and try to remember where all that stuff is defined.

      -Rez
    • RE: Linking problems

      I looked at the settings, and both dxutd.lib and gamecode2d.lib (the main two libraries defining the functions in question) are being outputted to the \Lib folder. There are no errors compiling and creating these libraries. In the Teapot Wars project settings, both of these libraries are listed in the Additional Dependencies catagory. Also, in the main Linker section of the project properties, the \Lib folder is listed as a library directory.
    • RE: Linking problems

      Hrm - it looks like you aren't building a Windows Application - all those missing symbols are part of the Windows API.

      Maybe you changed the build settings somehow?
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • RE: Linking problems

      Hey thanks for the post!
      Mr.Mike
      Author, Programmer, Brewer, Patriot