Stupid question
Hi
I''m new to programming C++, but I''m a pretty experienced Pascal/Delphi programmer. My problem is quite stupid..
When I try to compile lesson 5 MSVC++ 6.0 tells me the following.
So what does this mean? Please help..
Thanx,
Marty
--------------------Configuration: Lesson5 - Win32 Debug--------------------
Linking...
Lesson5.obj : error LNK2001: unresolved external symbol _gluPerspective@32
Lesson5.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
Lesson5.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
... a lot more, all opengl stuff...
Lesson5.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
Lesson5.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson5.exe : fatal error LNK1120: 21 unresolved externals
Error executing link.exe.
Lesson5.exe - 22 error(s), 0 warning(s)
_____ /____ /|| | || MtY | ||_____|/Marty
February 11, 2003 07:49 AM
you need to link to opengl32.lib , glu32.lib and glaux.lib
add the following code at the beginning of the program
after the includes
#pragma comment(lib, "opengl32.lib"
#pragma comment(lib, "glu32.lib"
#pragma comment(lib, "glaux.lib"
add the following code at the beginning of the program
after the includes
#pragma comment(lib, "opengl32.lib"

#pragma comment(lib, "glu32.lib"

#pragma comment(lib, "glaux.lib"

You haven''t told MSVC++ to link with the OpenGL libs (opengl32.lib, probably glaux32.lib)
See http://www.hackorama.com/opengl/
See http://www.hackorama.com/opengl/
thanx, that was 20 less errors :D
now it says something like this
--------------------Configuration: Lesson5 - Win32 Debug--------
Compiling...
Lesson5.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson5.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Lesson5.exe - 2 error(s), 0 warning(s)
Anyways, the opengl errors seem to be fixed, but the new error doesn''t tell me much.
Is there a help file on the debugger systax, or a better debuger?
Thanx,
Marty
now it says something like this
--------------------Configuration: Lesson5 - Win32 Debug--------
Compiling...
Lesson5.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson5.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Lesson5.exe - 2 error(s), 0 warning(s)
Anyways, the opengl errors seem to be fixed, but the new error doesn''t tell me much.
Is there a help file on the debugger systax, or a better debuger?
Thanx,
Marty
_____ /____ /|| | || MtY | ||_____|/Marty
windows.h
gl/gl.h
gl/glu.h
gl/glext.h
gl/gl.h
gl/glu.h
gl/glext.h
_____ /____ /|| | || MtY | ||_____|/Marty
In the linker options have you set the subsystem switch to
/subsystem:windows ?
-----
Losec
-----
/subsystem:windows ?
-----
Losec
-----
no, it was set to console... IT WORKS NOW!!! thanx a lot! Is there a way to start/make a template c++ program that has these settings for the linker?
_____ /____ /|| | || MtY | ||_____|/Marty
It works, but still the debugger is bugging me it says the following. Should I worry? It works right, what does it mean?
Loaded ''ntdll.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\kernel32.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\user32.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\gdi32.dll'', no matching symbolic information found.
... all the other dll''s
Loaded ''C:\WINDOWS\SYSTEM32\nvoglnt.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\mcd32.dll'', no matching symbolic information found.
The thread 0x340 has exited with code 27 (0x1B).
The program ''C:\Program Files\Microsoft Visual Studio\MyProjects\nehe\lesson05\Debug\Lesson5.exe'' has exited with code 27 (0x1B).
Loaded ''ntdll.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\kernel32.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\user32.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\gdi32.dll'', no matching symbolic information found.
... all the other dll''s
Loaded ''C:\WINDOWS\SYSTEM32\nvoglnt.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM32\mcd32.dll'', no matching symbolic information found.
The thread 0x340 has exited with code 27 (0x1B).
The program ''C:\Program Files\Microsoft Visual Studio\MyProjects\nehe\lesson05\Debug\Lesson5.exe'' has exited with code 27 (0x1B).
_____ /____ /|| | || MtY | ||_____|/Marty
no, these are not errors ... it is just informing you that there is no debug information available for those libraries ... so if you are browsing code, it will only show you the raw assembly ... IF you ever see this error on a library which you make, or a library you download which also has a debug version, it means you do not have the debug version in a location it can find ...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement