3

I'm having an issue when linking glew-1.9.0 statically with my project.

collect2.exe: error: ld returned 5 exit status

For the smallest test possible, just creating an OpenGL context (through SFML 2) and initializing glew, the linker exits with no error message when trying to link the static library.

I'm using MinGW with gcc 4.7.0. I find the same issue in both Eclipse for C++ and Code::Blocks. The same issue happens with both the compiled binary from glew and when I compile my own static library and link to it.

However, when I either link dynamically or include the glew.c source in the project, the program links and executes correctly.

I am using the GLEW_STATIC define, linking to opengl32, and remembering to include the library and the path to the library. If I just remove the define and use the dll version of the library it works. Anyone have any clue why this might be failing, or how I can fix it?

Kian
  • 1,654
  • 1
  • 14
  • 22
  • Perhaps the `-Wl,--verbose` option, maybe in conjunction with procmon from SysInternals, will help figure out what problem `ld` is having with the library. – Michael Burr Oct 26 '12 at 21:10
  • @Kian -- what is the actual ld error that provoked this? Or is there no output from ld whatsoever? – LThode Jan 27 '15 at 20:03

0 Answers0