OpenGl linking error

Hi,i write a simple program under windows showing a rectangle and i compile it with MinGw using the command line (I know IDE are better but just want to do it the old way) and this is the command line:

g++ main.cpp -L"lib" -lglfw3dll -lglew32dll

but the function glDrawArrays() still undefined and i dont know what library should i link to it or what i forget ?

[QUOTE=mounir;1285964]Hi,i write a simple program under windows showing a rectangle and i compile it with MinGw using the command line (I know IDE are better but just want to do it the old way) and this is the command line:

g++ main.cpp -L"lib" -lglfw3dll -lglew32dll

but the function glDrawArrays() still undefined and i dont know what library should i link to it or what i forget ?[/QUOTE]

Try to add “-lGL” also. This is where “common” OpenGL function symbols are defined.

The linker cannot find that library and i cant find it i seek my hole computer looking for libgl or something like that i just cant find it. please help it’s my final step to start learn opengl? should i download it? compile it? where can i find it?

True. Under Windows it should be called OpenGL32.dll

Thanks For Every one efforts We resolve it and this is the command line

C:\Users
idal\Desktop\metalslug3>g++ -o hellot.exe main.cpp -L"lib" -lglfw3dll -lglew32dll -lopengl32

I always link opengl32.lib… but then again, I’m new. Maybe there is a opengl32.dll???

Jeff

Ok, yeah, I just searched, and there are two files opengl32.dll, and opengl32.lib. So one is a library file you can link to, and another is dynamic link library, you can load and call functions from.

I learned something tonight,

Jeff

Just noticed, there are x64 and x86 versions of these files, with the same name. I just love Microsoft’s way of doing things.

Jeff