# OpenGL Trouble including gl/glu.h

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

## Recommended Posts

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) ?

##### Share on other sites
Inlucde windows.h before you include any GL headers.

##### Share on other sites
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 ??

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
Quote:
 Original post by Drew_BentonI 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

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 16
• 12
• 20
• 12
• 14
• ### Forum Statistics

• Total Topics
632155
• Total Posts
3004477

×