PDA

View Full Version : Bizarre Compiler Situation



sleepytime
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--------------------
Compiling...
go01.cpp
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)

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

sleepytime
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>

dvm
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.

sleepytime
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...

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

mikael_aronsson
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.

Mikael