Setting Up OpenGL?

Started by
5 comments, last by Flashthinker 16 years, 11 months ago
Hi, I wanted to start getting into OpenGL programming and I thought that I might try some sample source code before doing anything... And, unfortunately, out of the 6 different source codes I copy-pasted, NONE compiled. The error I got from most of them had to do with "undefined references" The error log starts-off like this; [Linker error] undefined reference to `glPushMatrix@0' [Linker error] undefined reference to `glBegin@4' [Linker error] undefined reference to `glVertex3f@12' And is followed by quite a few more of these... So I did some reseach and I found that I had to include these files in the compiler's "linkage" box... libopengl32.lib libglu32.lib ... So I did that, but I STILL get a bunch of errors; the first one said that it can't find "glaux.h" so I went in my Dev-C++ folder's GL directory and I added the glaux.h then I compiled again... And yet ANOTHER error came up: C:\Dev-Cpp\opengltest\Makefile.win [Build Error] [Project1.exe] Error 1 And I have NO idea how I could go about sloving this one. Should I just re-install Dev-C++? I just want to use Open GL... Why did they make it SOOOOOOOOOOO complicated to set up!!?!? Ironically, the hardest part of EVERY SINGLE desktop-based language I have tried, is setting them up! The programming bit is no-where near as frustrating >:( Thankfully though, I only have to do it once...
Advertisement
Hi,

First of all...it has nothing to do with OpenGL in particular. You will always have to setup a correct environment.

The very first steps when building an application is to include the correct libraries into your linker settings. In your case, besides the standard platform specific libraries, is "openg32.lib" and "glu32.lib" and maybe "glut.lib".
I think you just mistyped your library names.
Well if you do not want to modify the project settings everytime you start a new project with your files it might be easier to just add them with a preprocessor directive like #pragma comment(lib, "opengl32.lib") and so on. Library paths also need to be set correctly in your Development environment though.

Another important step when dealing with external libraries is to make sure all your include paths are set correctly in your IDE.

Hope this helps,
best regards

Quote:Original post by Acid-Chris
Hi,

First of all...it has nothing to do with OpenGL in particular. You will always have to setup a correct environment.

The very first steps when building an application is to include the correct libraries into your linker settings. In your case, besides the standard platform specific libraries, is "openg32.lib" and "glu32.lib" and maybe "glut.lib".
I think you just mistyped your library names.
Well if you do not want to modify the project settings everytime you start a new project with your files it might be easier to just add them with a preprocessor directive like #pragma comment(lib, "opengl32.lib") and so on. Library paths also need to be set correctly in your Development environment though.

Another important step when dealing with external libraries is to make sure all your include paths are set correctly in your IDE.

Hope this helps,
best regards


Thanks.
Hehe, I got it working just now... The filenames that I was told to import were wrong and the formatting was a bit different.
I had to go: "-lopeng32" and "-lglut"
... Pretty strange, at least I'm over it.
Quote:Original post by Flashthinker
Ironically, the hardest part of EVERY SINGLE desktop-based language I have tried, is setting them up! The programming bit is no-where near as frustrating >:(


Best regards, Omid
I find that the hardest part is turning on the computer.
I could create the next Doom or next Unreal, but turning things on is difficult.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
What's a computer?
Quote:Original post by V-man
I find that the hardest part is turning on the computer.
I could create the next Doom or next Unreal, but turning things on is difficult.


Laugh all you want... But that's kind of how I am right now.
It took me about 6 hours to try and set-up a PHP localhost on my system... I gave up and searched the net and found a program that did it for me lol.
But I did improve dramatically since then... about 9 months ago, I set up my Java environment in just 3 hours!
And more recently, I set up ASP.NET localhost in just 20 minutes! - It was the proudest day of my life.

I get nightmares of myself trying to set up a network...
Also, today was quite good; I managed to solve my OpenGL problem in what? Less than an hour!?

This topic is closed to new replies.

Advertisement