PDA

View Full Version : SuperBible program won't run



CaptCanada
07-18-2003, 04:14 AM
Hi everyone

I am new to OpenGL and I am having trouble getting a program from the OpenGL SuperBible to run.

I have MSVC++ and Glut 3.7. The Glut32.dll is in my Windows/System32 dir. The Glut.h is in my VC98 include dir and the Glut32.lib is in my VC98 lib dir

Here is the code and the error
#include <windows.h>
#include <gl\glut.h>

void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void SetupRC(void)
{
glClearColor(0.0f,0.0f,1.0f,1.0f);
}

void main(void)
{
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutCreateWindow("Simple");
glutDisplayFunc(RenderScene);

SetupRC();

glutMainLoop();
}
unexpected end of file while looking for precompiled header directive

I am sure I have everything linked right.I have the glut32.lib added to my link list and have instructed the compilier to use the VC98 lib and include dir's.

Any help to resolve this problem would be greatly appreciated!

Thanks for the patience
Don

kehziah
07-18-2003, 04:30 AM
Menu Project\Settings...
Tab C/C++
Category Precompiled Headers
Choose "Not using precompiled headers"

zix99
07-18-2003, 05:35 AM
I'm not a C++ expert, but where this it:


glutMainLoop();
}


shouldn't it be like this

glutMainLoop();
{
}

nexusone
07-18-2003, 06:02 AM
No there is no error in his usage of glutMainLoop.
It is a routine from the glut library and is placed at the end of the main routine.



Originally posted by zix99:
I'm not a C++ expert, but where this it:
shouldn't it be like this

glutMainLoop();
{
}

CaptCanada
07-18-2003, 06:24 AM
Thanks to everyone for your help

CaptCanada
07-18-2003, 06:31 AM
It works, but now I get this error when the program runs
"The procedure entry point glutCreateWindowWithExit could not be located in the dynamic link library glut32.dll"

Thanks for the help

CaptCanada
07-18-2003, 06:40 AM
I guess I should read previous posts before posting a new post? Sorry for that tongue twister.

The code now runs,now that I have the new glut32.dll etc.

thanks again