Sign in to follow this  
nicolasbrown

stupid glut

Recommended Posts

i keep getting the feeling that visual c++ isnt the software i need to compile my files. I followed all the installation instruction on this site http://csf11.acs.uwosh.edu/cs371/visualstudio/#contents i am still getting an error: ------ Build started: Project: last window, Configuration: Debug Win32 ------ Compiling... window.cpp c:\documents and settings\nicolas\my documents\visual studio 2008\projects\project1\last window\window.cpp(4) : fatal error C1083: Cannot open include file: 'gl\glut.h': No such file or directory Build log was saved at "file://c:\Documents and Settings\Nicolas\My Documents\Visual Studio 2008\Projects\Project1\last window\Debug\BuildLog.htm" last window - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== here is the code: #include <windows.h> /* obviously change this to your native library if you're compiling under unix */ #include <gl\gl.h> #include <gl\glut.h> void init(void); void display(void); int main (int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(250, 250); glutInitWindowPosition(100, 100); glutCreateWindow("My First OpenGL Application"); init(); glutDisplayFunc(display); glutMainLoop(); return 0; } void init(void) { glClearColor(0.0, 0.0, 0.0, 0.0); glColor3f(0.0, 0.0, 1.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-10.0, 10.0, -10.0, 10.0, -10.0, 10.0); } void display(void) { glClear(GL_COLOR_BUFFER_BIT); glRectf(-5.0, 5.0, 5.0, -5.0); glutSwapBuffers(); } what should i do now?

Share this post


Link to post
Share on other sites
Make sure you have glut.h inside of the gl\ directory of your INCLUDE path.

For example, in MSVC++ 2005 (I suspect 2008 is simular), it should be here:
\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl\


The error is occurring because it is looking in this path, but is not finding glut.h inside of the gl/ subdirectory.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this