Menu

Simple1 project -> linking error

Help
Crystaline
2005-06-24
2012-12-05
  • Crystaline

    Crystaline - 2005-06-24

    Hello,

    I tried to get the Simple1 project (G:\projects\CS\apps\tutorial\simple1) working, but I get this linking error :
    G:\projects\CS\out\msysx86\debug\libs\libcrystalspace.a(win32.o)(.text+0xe32) In function `ZN14Win32AssistantC2EP15iObjectRegistry':

    I have created a new Win32 Console application in Dev-C++ called Project1 and copied the two files simple1.cpp and simple1.h from G:\projects\CS\apps\tutorial\simple1 into the project. I use MinGW as a compiler and in the Project Options I placed these libraries :
    ../CS/out/msysx86/debug/libs/libcrystalspace.a
    ../CS/out/msysx86/debug/libs/libcrystalspace_windows.a
    ../CS/out/msysx86/debug/libs/libcrystalspace_opengl.a
    ../CS/out/msysx86/debug/libs/libcrystalspace_directx.a
    ../CS/out/msysx86/debug/libs/libcrystalspace.a
    ../CS/out/msysx86/debug/libs/libcrystalspace_windows.a
    ../CS/out/msysx86/debug/libs/libcrystalspace_opengl.a
    ../CS/out/msysx86/debug/libs/libcrystalspace_directx.a
    (twice as mentioned in the tutorial)

    I really have no idea why I get the linking error. Can anyone help me, please ?

    Kind Regards

     
    • Eric Sunshine

      Eric Sunshine - 2005-06-24

      This is not a complete error message; it doesn't even show the actual error. Perhaps you failed to copy the entire thing.

      What version of CS are you using? With CVS version of CS, you should not need to list the libraries twice (though you may want to list libcrystalspace.a last).

       
    • Crystaline

      Crystaline - 2005-06-24

      Oh, indeed, I'm sorry, I failed to copy the entire linking error. This is the complete linking error(s) :

      ../CS/out/msysx86/debug/libs/libcrystalspace.a(win32.o)(.text+0xe32): In function `ZN14Win32AssistantC2EP15iObjectRegistry':
      g:/projects/cs/libs/csutil/win32/win32.cpp:453: undefined reference to `GetStockObject@4'
      ../CS/out/msysx86/debug/libs/libcrystalspace.a(win32.o)(.text+0x1742): In function `ZN14Win32AssistantC1EP15iObjectRegistry':
      g:/projects/cs/libs/csutil/win32/win32.cpp:453: undefined reference to `GetStockObject@4'
      collect2: ld returned 1 exit status

      make.exe: *** [Project1.exe] Error 1
      Execution terminated

      I probably get the linking error twice because I twice linked all libraries. I dowloaded a daily snapshot of CS on june 13th.

      Kind Regards

       
      • Eric Sunshine

        Eric Sunshine - 2005-06-24

        GetStockObject() is a Windows function which resides in gdi32.lib, so you will also need to link against that Microsoft-supplied library.

         
    • Crystaline

      Crystaline - 2005-06-25

      That solved the problem !

      Thank you very much, Eric.

       

Log in to post a comment.