GCC, linking libraries, not found?

前端 未结 3 1831
遇见更好的自我
遇见更好的自我 2021-01-06 12:11
  • OS: Windows 7 Pro X64
  • IDE: Eclipse IDE for C/C++ Developers
  • Compiler: MinGW (lastest, 4.5.2)

Compiling HelloWorld.c works; but when I

3条回答
  •  灰色年华
    2021-01-06 12:51

    My experience (which doesn't include how this might be configured in Eclipse) is that ld (which gcc will invoke) wants the lib names without the lib prefix or the .a extension. Try:

    gcc -LC:\rhino\data\libs -LC:\rhino\data\lib -oTestC.exe TestC.o -lglfw -lglfwdll
    

    I'm not sure that the glfw.dll file should be listed as a library; the import library for that DLL (I assume that's libglfwdll.lib) should take care of linking to the DLL.

提交回复
热议问题