Alexander Bily
Alexander Bily

Reputation: 975

Linking GLEW fail

I am trying to link GLEW to my project. I am using CodeBlocks, linker and compiler paths are properly set. In my library, there are two files (glew32.lib & glew32s.lib). When I tried to link -lglew32s, my linker complained:

ld.exe||cannot find -lglew32s|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

What could possibly be a problem here? When I changed -lglew32s to -lglew32, I got other type of errors (undefined references) that are related to dynamic linking, so I know my path is set properly.

Upvotes: 1

Views: 452

Answers (1)

user3285991
user3285991

Reputation:

You should probably build GLEW from source to get lib<name>.a import libraries. My recommendation is to grab the source from here and build it with MSYS2. You might be able to find some tutorials on Google if you need more specific instructions.

However, I've been told by sschuberth in the comments that this could be compatible, which makes sense because one of your libraries worked. If you're sure both of these libraries exist in a path the linker knows about, I don't know exactly why this would happen. Either it's an incorrect commend line, or you don't really have all of your libraries where you say you do. Please show your command line for gcc and the files in the GLEW folder so I can better understand your situation.

Upvotes: 1

Related Questions