Jump to content
  • Advertisement
Sign in to follow this  
Twisol

Problems compiling code from the OpenGL tutorials

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using the compiler/IDE called Bloodshed Dev-C++, and am trying to compile code from the first 5 tutorial lessons. Dev-C++ comes with some OpenGL .h files, and I got the glaux.h from a DevPak. When I compile a file (say, the code from tutorial 1), I get tons of linker errors. The DevPak manager in Dev-C++ is supposed to put the files where they belong, so it can't be that. Any idea what's wrong? By the way, the errors look like this... In function Z13ReSizeGLSceneii: [Linker error] undefined reference to glViewpoint@16

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by linkofazeroth
I'm using the compiler/IDE called Bloodshed Dev-C++, and am trying to compile code from the first 5 tutorial lessons. Dev-C++ comes with some OpenGL .h files, and I got the glaux.h from a DevPak. When I compile a file (say, the code from tutorial 1), I get tons of linker errors. The DevPak manager in Dev-C++ is supposed to put the files where they belong, so it can't be that. Any idea what's wrong?

By the way, the errors look like this...
In function Z13ReSizeGLSceneii:
[Linker error] undefined reference to glViewpoint@16


You need to link to opengl (and maybe glu)

libOpengl32.a
libglu32.a

-lopengl32 -lglu32

Share this post


Link to post
Share on other sites
So would I #include those files? It was working about 15 minutes ago (and I completed tutorial 5 when it stopped working)

Share this post


Link to post
Share on other sites
Quote:
Original post by linkofazeroth
So would I #include those files? It was working about 15 minutes ago (and I completed tutorial 5 when it stopped working)


No. You include header files, not code libraries. You need to LINK the files I listed. Look in your project options and add them to your linker commands. I stopped using devC++ a while ago, I forget the name of the menu option to select sorry. It may be compiler options, or project settings or build options. [sad]

Share this post


Link to post
Share on other sites
Quote:
Original post by linkofazeroth
I think it's compiler options. So which folder are the files I need to link to in?


They are in lib/gl but you can just type this I think

-lopengl32 -lglu32

Share this post


Link to post
Share on other sites
Quote:
Original post by linkofazeroth
There's no gl folder in lib. :(
Look in the mingw folder. DevC++ is not a compiler, it's an IDE. MingW is the compiler that comes with it, and it inclues OpenGL

Include OpenGL before GLU.

Share this post


Link to post
Share on other sites
I didn't know that... huh. Well, mingw32/lib has to gl folder either. :( Only gl folders I see anywhere are in the include folder.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The lib files are in the lib folder under the name of libOpengl32.a for bloodshed but all you need to do is add "-lopengl32 -lglu32" to the linker options for your project

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!