Help me please!!!

i am writing my first opengl program in visual c++ 6.0 using Molofee’s tutorials

but now this happen…--------------------Configuration: 1 - Win32 Debug--------------------
Linking…
1.obj : error LNK2001: unresolved external symbol _gluPerspective@32
1.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
1.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
1.obj : error LNK2001: unresolved external symbol __imp__glHint@8
1.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
1.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
1.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
1.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
1.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/1.exe : fatal error LNK1120: 11 unresolved externals
Error executing link.exe.

1.exe - 12 error(s), 0 warning(s)

perhaps you add opengl32.lib and glut32.lib to Projects->preferences->linker (i don’t know if these menu-points are correct cause i only have VC6++ German version…)

or simply press alt+f7

I have got the same problem with Builder Borland 5 !! What can this be ?

You need to include the libraries in your project. Not sure specifically how to do that for Builder, but Mcbastian’s description of how to do that for VC++ 6.0 works for the US version as well.

If you are using glut, you shouldn’t need to include the libraries in your project as they are already included in glut.h.

taken from glut.h :
#pragma comment (lib, “winmm.lib”) /* link with Windows MultiMedia lib /
#pragma comment (lib, “opengl32.lib”) /
link with Microsoft OpenGL lib /
#pragma comment (lib, “glu32.lib”) /
link with OpenGL Utility lib /
#pragma comment (lib, “glut32.lib”) /
link with Win32 GLUT lib */

As you can see you don’t really need to include the libraries in your project the way it is meant to be done in CBuilder or vc++. You can simply add the following line to your code

#pragma comment (lib, “mylib.lib”)

thus even if you don’t use glut simply add the following lines to your program :

#pragma comment (lib, “opengl32.lib”)
#pragma comment (lib, “glu32.lib”)

Ah, yes one other thing… for you umount. If you are using Borland CBuilder 5 you might need to use the implib utility to make new .lib files as CBuilder doesn’t use the same format of .lib as vc++. I needed to do that with CBuilder 4 for glut32.lib.
Implib can be found in the bin directory of your CBuilder installation and the command line is
implib <path>\glut32.lib <path>\glut32.dll

Moz