# use glew with Dev-C++

This topic is 4963 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I want to use glew with Dev-C++ I think it is possible because, exemple exist. But they dont work, there is a "link error". I add "-lglew" in compiler option, and it s dont work :( he says : "cannot find -lglew" :( please help me ps : i am french (my english is not perfect)

##### Share on other sites
Dev-C++ (or rather, the MinGW linker) uses .a library files instead of .lib, so you'll need to compile the GLEW library yourself to be able to link to it. It's either that, or find somebody else who has already done so.

*Several minutes later*

Okay, I just finished compiling it for you. :)

glew.a

##### Share on other sites
thank :)

but I have add "glew.a" in the lib/ dirrectorie, and there is the same error.
He say : "cannot find -lglew"

In my compiler option i have :
"-lglew -lopengl32 -lglut32 -lglu32 -lcg -lcgGL"

ps : i use windows

##### Share on other sites
Try renaming it to libglew.a

##### Share on other sites
MinGW doesn't care if it's .lib or .a, just as long as it understands its structure. In saying that, the problem here is probably due to the fact that the compiler has nfi what you're talking about, because you haven't set the libraries path. In Dev-C++, click Tools, then Compiler Options, then Directories, then Libraries, and add the path to your library (click Delete Invalid to check it), and click OK. If it still doesn't find it, then I'm out of ideas.

##### Share on other sites
Quote:
 Original post by CocalusTry renaming it to libglew.a

This helped me too, so i think it will solve your problem (at least when you have an a. file, otherwise supply the complete path without the -l).

##### Share on other sites
i have rename the lib
now he know "-lglew" !

but there is a link problem

ex1.o(.text+0x139):ex1.cpp: undefined reference to _imp__glewInit'

ex1.o(.text+0x14f):ex1.cpp: undefined reference to _imp__glewGetErrorString'
ex1.o(.text+0x16d):ex1.cpp: undefined reference to `_imp__glewGetString'

##### Share on other sites
You can just add the glew32.dll directly to the linker. Just download the windows binarys from the GLEW website. Copy the glew32.dll into your project directory. Then From dev-cpp just
Project
Project Options
Parameters
Switch Files Type to all files (*.*)
Select glew32.dll
Remove any old references to GLEW from that list (ie -lglew).
Click Ok

And it should compile (I just got this to work on my system).

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634060
• Total Posts
3015300
×