View Full Version : Bizarre Compiler Situation

01-15-2005, 04:38 AM
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)

01-15-2005, 05:24 AM
#include <GL/gl.h> ?

01-15-2005, 05:29 AM
Yep. Even tried linking the libraries in Project/Settings

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

01-15-2005, 04:41 PM
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.

01-16-2005, 05:47 AM
Yep, checked they were there.

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

01-18-2005, 07:00 PM
check the date of modification of the files

01-18-2005, 11:23 PM
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.