Bizarre Compiler Situation

No matter how many #pragmas #includes and library links I set up my Compiler can’t find the basic gl functions. It finds the glut based ones fine.

Any help would be very much appreciated.

--------------------Configuration: go01 - Win32 Debug--------------------
C:\OpenGL\cs300\go01\go01.cpp(23) : error C2065: ‘glEnable’ : undeclared identifier
C:\OpenGL\cs300\go01\go01.cpp(33) : error C2065: ‘glClearColor’ : undeclared identifier
C:\OpenGL\cs300\go01\go01.cpp(39) : error C2065: ‘glClear’ : undeclared identifier
C:\OpenGL\cs300\go01\go01.cpp(40) : error C2065: ‘glFlush’ : undeclared identifier
Error executing cl.exe.

go01.obj - 4 error(s), 0 warning(s)

#include <GL/gl.h> ?

Yep. Even tried linking the libraries in Project/Settings

#include <stdio.h>
#include <windows.h>
#include <GL/gl.h>
#include <GL/glut.h>

Have you look for the file yourself to make sure it’s there? I believe you use visual studio. It’s under $VSTUDIOPATH/VC98/Include/ I think. In .net 2003 it’s in $VSTUDIOPATH/VC7/PlatformSDK/Include.

Yep, checked they were there.

Maybe the file’s got corrupted over the years. Where can I locate the latest ones…

check the date of modification of the files

Hi !

Do you include any other files before gl.h ? or use any weird #define’s or something like that ?

If you don’t get any error about includind gl.h and yu do include it in the source file then there can be two problems.

You might #define something that prevents it from being loaded, as a stupid example: if you do #define _gl_h before including gl.h you will not get anything at all included.

Another thing is that you use precompiled headers, they can mess up you life some times, if you do make sure you do a “rebuild” or delete the .pch file before you compile.

You can also check that the file is actually included, after you include gl.h do a test with #fdef GL_VERSION_1_1 and print out some message if it exists.