use glew with Dev-C++

Started by
6 comments, last by Cocalus 18 years, 10 months ago
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)
Advertisement
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
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
Try renaming it to libglew.a
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.
Quote:Original post by Cocalus
Try 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).

Crafter 2D: the open source 2D game framework

?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

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'
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
Add Library or Object
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).

This topic is closed to new replies.

Advertisement