Linker exits when linking glew statically

508 Views Asked by At

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?

0

There are 0 best solutions below