dev C++ openGL compile problems - fix

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
roid
DBB Master
DBB Master
Posts: 9990
Joined: Sun Dec 09, 2001 3:01 am
Location: Brisbane, Australia
Contact:

dev C++ openGL compile problems - fix

Post by roid »

i wouldn't be surprised if a lot of people get these kindof errors while learning to program.
basically if you are having trouble compiling things you have just downloaded from the net (ie: tutorials) you are likely having trouble with the "linking".
there seems to be a lot of explanations of howto deal with that around the net. but since it helped me, i'll shove it here too.

click through to project/options/parameters. under linker add this in there:
-lopengl32 -lglut32 -lglu32
you may need more. but this is general idea of howto link librarys in devcpp. you'll notice that in the filesystem librarys will be called stuff like libopengl32.a , this means you link it you type in -lopengl32 (ie: leave off the lib, add in a -L, no space, and leave off the extension)


anyway, after you have fixed that you may still be getting these problems, which look like linking problems, but actually are NOT....
- When you attempt to link the library functions, you may get a linker error of '__glutInitWithExit@12', '__glutCreateWindowWithExit@8', or '__glutCreateMenuWithExit@8'. If you get these errors, you must add the line:
#define GLUT_DISABLE_ATEXIT_HACK
to the top of file before the includes. According to the glut header this "enabled features before defining the upper macro."
this really helped me. and took a while to find online, so.. splat... here it is for others.
User avatar
Ferno
DBB Commie Anarchist Thug
DBB Commie Anarchist Thug
Posts: 15012
Joined: Fri Nov 20, 1998 3:01 am

Post by Ferno »

I believe Dev C++ 4.9.9.0 and higher now have that built in. I'm not sure though.
Post Reply