PDA

View Full Version : OpenGL and GLUT primer (a little bit frustrated)



emres
07-09-2002, 06:18 AM
Hi,

I'm new to OpenGL and GLUT programming.

I thingk I've got trouble not with OpenGL but with GLUT on Windows2000 Professional. I think so because when I download and try to run the compiled versions of GLUT examples from:
http://www.opengl.org/developers/code/glut_examples/examples/examples.html

My system tells me that "The dynamic link library glut.dll cannot be found in the specified path: C:\WINNT\System32; ...."

I also looked at a site:
http://aslan.wheatonma.edu/~nbuggia/coursework/graphics/openGL_vcpp.html

Telling me that I need:

glut.dll
glut.h
glut.lib
glut32.dll
glut32.lib

However when I download glut-3.7.6-bin.zip from:
http://www.xmission.com/~nate/glut.html

All I get is:

glut.def
glut.h
glut32.dll
glut32.lib
README-win32.txt

nothing like glut.dll or glut.lib. So I cannot run the programs and also when I try to compile them with Visual C++ (VC7, Visual Studio.NET) they compile OK but when I try to build the program it says that:

fatal error LNK1120: 1 unresolved externals
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartUp

You can see the source code at:
http://www.opengl.org/developers/code/glut_examples/examples/cube.c

I hope if somebody can help me because I'm just stuck at this point and just cannot try any examples.

emres
07-09-2002, 06:35 AM
Well, I solved my problem even though I'm not sure how I exactly did that.

I've just created a new and empty (!) Win32 Console Application in Visual Studio.NET (Visual C++) pasted the same OpenGL/GLUT code, compiled and built it without any problems! The resultin .exe file ran smoothly without any problems.

Thanks to everyone who spent their times for trying to find out what my problem was in the previous message (still seems a mystery to me).

Bob
07-09-2002, 09:47 AM
There are two types of executable projects; Console Application and Application. Application uses a WinMain as entry point in your program, and Console Application uses a main as entry point. Depending on which of these function your code has, main or WinMain, you should create the correct type of project.

So there's nothing mysterious about it, just some lack of knowledge about your compiler http://www.opengl.org/discussion_boards/ubb/smile.gif

emres
07-10-2002, 12:30 AM
Originally posted by Bob:
There are two types of executable projects; Console Application and Application. Application uses a WinMain as entry point in your program, and Console Application uses a main as entry point. Depending on which of these function your code has, main or WinMain, you should create the correct type of project.

So there's nothing mysterious about it, just some lack of knowledge about your compiler http://www.opengl.org/discussion_boards/ubb/smile.gif


Well, in my problematic trial the system was trying to produce a Console App, however I should've missed something so that it didn't work, but when I started a new project, made it an EMPTY Console App it compiled and ran smoothly.

For my knowledge about the compiler, you're definitely right. The last time I've done C/C++ coding the mainstream compiler was Turbo C++ ;-)

Thanks for your comments.

emres
07-10-2002, 03:35 AM
One thing has drawn my attention about GLUT:

If glut.h includes gl.h then why do so many examples start with:

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

and cause the poor compiler trouble with "redefined" stuff?

Is there some deeper reason? Is it different in Linux/UNIX environment? In my Win2000 environment and VC++ I just inclued the glut.h and everything works fine.