PDA

View Full Version : Linking errors at building OpenGL Program :(



Motagaly
07-17-2002, 11:46 PM
Hi PalZ ...

I dont know what to do with this error :

[ Compiling...
gl1.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/gl1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

gl1.exe - 2 error(s), 0 warning(s)]


i'm working on MS Visual c++ 6 ...

i'm working on WindowsXP bulid2600 ...

i've added the Lib files to the Settings|link|object/library modules
glu32.lib , glut32.lib , opengl32.lib .

i've added glu32.dll & glu32.lib & glut32.dll & glut32.lib &
opengl32.dll & opengl32.lib .

i've included gl.h & glu.H & glut.32.H

PleeeeeeeeeeeeeeeeeeeeeeeeeZ Help Me ....

email me at [motagaly@yahoo.com]

Thanx 4 any help ...

zobel
07-18-2002, 12:52 AM
just type:

#include <GL/glut.h>

that should work fine.
enjoy!

Motagaly
07-18-2002, 01:11 AM
i've already copy the *.h files
thr 3 files gl.h & glu.h & glut.h from

$(MSVC Directory)/include/GL/*.h

to the

$(MSVC Directory)/include/*.h


but it give me the same error ...
i think there is a problem with WinXP ...

Any WaY ... ThanX alot Great Man http://www.opengl.org/discussion_boards/ubb/smile.gif

Bob
07-18-2002, 01:14 AM
Why would including the GLUT header fix the missing symbol? Including a header is a compile time process, and the missing symbol is a linker error.

You have created the wrong type of executable project. There are two common types; Application and Console Application. An Application requires a WinMain() function, and a Console Application requires a main() function. Dependeing on which of these two functions you have, you have to create the right type of project.

Bob
07-18-2002, 01:15 AM
i think there is a problem with WinXP

No, the problem is that you don't know your compiler enough. The settings of your project does not match the code.

zobel
07-18-2002, 01:25 AM
ooops!
bob's right.