Errors in VC++

Hi,

I can’t even draw a OpenGl window! There’s not anything wrong whith the code; it compiles great, but when I try to build it this is what I get:

Linking…
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
Lesson1.obj : error LNK2001: unresolved external symbol _gluPerspective@32
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glHint@8
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
Lesson1.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Lesson1.exe : fatal error LNK1120: 15 unresolved externals
Error executing link.exe.
Lesson1.exe - 16 error(s), 0 warning(s)

Anyone know what it means? I’m using VC++ 4.2 and Windows ME.

Those are all link errors, not compile errors. Make sure you’re linking opengl32.lib in your project settings.

Thanx, but I still miss one file… Look at this:

Lesson1.obj : error LNK2001: unresolved external symbol _gluPerspective@32
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Lesson1.exe : fatal error LNK1120: 2 unresolved externals

Still to linking errors

Ebbe

Thanx, but I still miss one file…

glu32.lib

b

Unresolved Symbol _main means that you started your app as a Win32 console, but the code you are giving is a Win32 App.

Win32 console uses a main() function for the entry point. Win32 Application uses WinMain() as the entry point.

Great!! It works!