Trouble including gl/glu.h

Started by
4 comments, last by MARS_999 19 years, 2 months ago
Hi, I kinda new in using OpenGl, I'm trying to include glu.h by simply doing this : #include <gl/glu.h> it seems fine, as I saw other project doing this and it compiled correctly but when I got to do this I always get like 100s of errors. mostly this error : "e:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152): error C2501: 'WINGDIAPI' : missing storage-class or type specifiers" can somebody tell me what to do ? I'm using VC .net, is there anything that my VC/proj settings I have to change ? How come other projects compiled correctly (on the same VC) ?
Ride the thrill of your life
Play Motorama
Advertisement
Inlucde windows.h before you include any GL headers.
-----BEGIN GEEK CODE BLOCK-----Version: 3.12GCS/M/S d->+(++) s+: a19? C++++ UL++ P+++ L+ !E W+++ N+ o++ K? w!O M-- V? !PS PE Y+ PGP t++ 5+++ X R tv+> b+(++)>+++ DI+++>+++++ D++G e>++++ h! r y?------END GEEK CODE BLOCK------
thanks ;) that solved the problem but now comes another problem..
I got all this unresolved external symbol error like this when linking/building the project :
"engine1 error LNK2019: unresolved external symbol _gluNewTess@0 referenced in function "public: void __thiscall CPolygon::Tesselate(void)" (?Tesselate@CPolygon@@QAEXXZ)"

now I know this maybe because I forget to include some lib, but I've done that in my project settings, I've allready add glut.lib and glut32.lib to my project linker settings.

Are there any settings that I must add/change ??
Ride the thrill of your life
Play Motorama
I think you need to link in opengl32.lib and glu32.lib -
#pragma comment(lib,"glu32.lib")#pragma comment(lib,"opengl32.lib")


Also I do not think there is a "glut.lib" file, so if it says it cannot be found, then remove it. The correct one is as you have, glut32.lib. Here is the reference for that.

- Drew
dont pragma comment your libs, not all compilers interpret #pragma the same way, instead use the project options so you dont run into trouble

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:Original post by Drew_Benton
I think you need to link in opengl32.lib and glu32.lib -
#pragma comment(lib,"glu32.lib")#pragma comment(lib,"opengl32.lib")


Also I do not think there is a "glut.lib" file, so if it says it cannot be found, then remove it. The correct one is as you have, glut32.lib. Here is the reference for that.

- Drew


add those two libs to your project with add exisiting item under the project menu

This topic is closed to new replies.

Advertisement