Looking for: Good opengl tutorial

I am looking for a decent OpenGL tutorial, one that doesn't use GLAUX (all the ones I found needed glaux and I don't wish to use glaux).

I have used opengl in pascal and I have used C++ but haven't used GL and C++ together before.
Last edited on
http://www.swiftless.com/tutorials/opengl/opengltuts.html
This seems all right, though I haven't observed it in great detail.
Also it uses glut an i myself prefer to do stuff manually.
Anyway I'm glad to have found something organised. I may even finaly take a look at glsl...
I tried to compile this with MiniGW and I got many errors...

(http://www.swiftless.com/tutorials/opengl/cplusplus/window.cpp)


F:\Daniel\Lazarus projects\Applications\Win32_Unix_Mac\utilities\gcc run tool>gcc F:\Daniel\CProjects\gltest1.c -o F:\Daniel\CProjects\gltest1.exe
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x1c): undefined reference to `__glutInitWithExit@12'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x3c): undefined reference to `__glutCreateWindowWithExit@8'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x5c): undefined reference to `__glutCreateMenuWithExit@8'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x91): undefined reference to `glClearColor@16'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0xa0): undefined reference to `glClear@4'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0xa8): undefined reference to `glLoadIdentity@0'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0xe6): undefined reference to `gluLookAt@72'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0xee): undefined reference to `glFlush@0'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x13b): undefined reference to `glutInitDisplayMode@4'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x152): undefined reference to `glutInitWindowSize@8'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x169): undefined reference to `glutInitWindowPosition@8'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x187): undefined reference to `glutDisplayFunc@4'
C:\DOCUME~1\Daniel\LOCALS~1\Temp/ccuAJeUg.o:gltest1.c:(.text+0x18f): undefined reference to `glutMainLoop@0'
collect2: ld returned 1 exit status


I don't know how to solve this, please help
Last edited on
You need to link with the appropriate libraries.

gcc gltest1.c -o gltest1 -lglut32 -lopengl32

The libraries you link with vary depending on exactly what libraries you are using. I use FreeGlut, so I link with -lfreeglut. Etc. If you are using glu stuff, you may also need -lglu32.

For all things OpenGL, see
NeHe Productions
http://nehe.gamedev.net/

Another place to begin looking for stuff is straight from the horse's mouth:
http://www.opengl.org/resources/libraries/glut/

Good luck!
after adding -lglut32 -lopengl32 to the compiler command line i get less erors but there are still some...

 [Linker error] undefined reference to `__glutInitWithExit@12' 
  [Linker error] undefined reference to `__glutCreateWindowWithExit@8' 
  [Linker error] undefined reference to `__glutCreateMenuWithExit@8' 
  [Linker error] undefined reference to `gluLookAt@72' 
  ld returned 1 exit status 


(I am using Dev-cpp 4.9, gcc 3.4.2)
I have managed to sort out the 'gluLookAt' error (forgot to add -lglu32) but the other glut errors still remain.
http://www.xoax.net/

C++ OpenGL Video Tutorials :

http://xoax.net/comp/cpp/opengl/index.php

Enjoy :)
Last edited on
these tutorials produce similar errors (xoax.net) swiftless is the one that I would prefer as they don't use glaux and I want to avoid using glaux at all cost.
well..... you're welcome.
I found this one a day or so ago: http://www.spacesimulator.net/tut1_3dengine.html
I haven't actually read it yet, I plan to use it later though.
I've got it sorted now, i just added the following to the begining of the file...

#define GLUT_DISABLE_ATEXIT_HACK

and used the -lglut32 -lopengl32 options

I am now using the swiftless tutorials as a starting point, thanks for all your help!
Last edited on
Topic archived. No new replies allowed.