Error LNK2001 help!!!!!! ARGH!!!#!#$!@$#@!#
I downloaded some of tutorials from NEHE''s wonderful website. I opened CPP files and executed it. I got error message that prevent me from compling exe from CPP. Anybody plz help me fix it. Im gonna be nut without NEHE''s wonderful tutorials!!!!!! Please reply asap!!!! ARGH@!$$#@!$%@#$%
Perhaps you could post the exact error message you receive. Does it say something like ''Unresolved external symbol _WinMain@16'' ?
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
try adding the following lines to thetop of your code
|
Those who dance are considered insane by those who cannot hear the music.
--------------------Configuration: Lesson12 - Win32 Debug--------------------
Compiling...
Lesson12.cpp
Linking...
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glEndList@0
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2f@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glNormal3f@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glNewList@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glGenLists@4
Lesson12.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTexParameteri@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTexImage2D@36
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glBindTexture@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glGenTextures@8
Lesson12.obj : error LNK2001: unresolved external symbol _gluPerspective@32
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glHint@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glCallList@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glColor3fv@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson12.exe : fatal error LNK1120: 32 unresolved externals
Error executing link.exe.
Lesson12.exe - 33 error(s), 0 warning(s)
=================================================================
That is what error I got
Waldoo
Compiling...
Lesson12.cpp
Linking...
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glEndList@0
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTexCoord2f@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glNormal3f@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glNewList@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glGenLists@4
Lesson12.obj : error LNK2001: unresolved external symbol _auxDIBImageLoadA@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTexParameteri@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTexImage2D@36
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glBindTexture@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glGenTextures@8
Lesson12.obj : error LNK2001: unresolved external symbol _gluPerspective@32
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glHint@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glCallList@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glColor3fv@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
Lesson12.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
Lesson12.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
Lesson12.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson12.exe : fatal error LNK1120: 32 unresolved externals
Error executing link.exe.
Lesson12.exe - 33 error(s), 0 warning(s)
=================================================================
That is what error I got
Waldoo
Did you create a project? If so, make sure it is a Win32 Application (not console). Secondly, you have to make sure to link opengl32.lib and glu32.lib.


Terminate: I tried your new code, the error i got left is
--------------------Configuration: Lesson12 - Win32 Debug--------------------
Compiling...
Lesson12.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson12.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Lesson12.exe - 2 error(s), 0 warning(s)
---------------------------------------------------------
Anyone may reply for suggestion to resolve this problem
Waldoo
Edited by - waldoo on January 27, 2002 12:31:26 AM
Edited by - waldoo on January 27, 2002 12:37:52 AM
--------------------Configuration: Lesson12 - Win32 Debug--------------------
Compiling...
Lesson12.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson12.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Lesson12.exe - 2 error(s), 0 warning(s)
---------------------------------------------------------
Anyone may reply for suggestion to resolve this problem
Waldoo
Edited by - waldoo on January 27, 2002 12:31:26 AM
Edited by - waldoo on January 27, 2002 12:37:52 AM
I told you to make sure you don''t make a console application
. If you really did make a "Win32 Application," then that error is weird.



January 28, 2002 12:02 AM
I am newbie to VC++ could you please post brief tutorial how to reverse win32 console application?
Waldoo
Waldoo
To convert a project that was created as a Console Application into a Win32 Application go:
Project->Settings and click on the Link tab.
In the Project Options section look for /subsystem:console. Then replace it with /subsystem:windows.
This will make the linker look for WinMain and not main.
An optional thing to do is to change the _CONSOLE preprocessor definition into _WINDOWS. It''s optional because I don''t believe it _CONSOLE is used in any of the Win32 headers. It is mainly for the programmer to check if his/her app is compiled as a console or Win32 app.
Thank you all for the codes, it resolved most of the problem I have with Nehe''s lesson #8. My VC++ is able to run the program but has slight problem, the texture mapping on a box is kinda weird half of square is all smeared. I think its probably a single mistyped in the script. I will review through it to find the error. But after running the program VC++ posted error like this below. I would like to have all bugs fixed anyone pls help with this plm.
Thank you
Waldoo
Loaded ''C:\WINDOWS\SYSTEM\DCIMAN32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\GLU32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\CRTDLL.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\OPENGL32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\ADVAPI32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\GDI32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\USER32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\KERNEL32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\PGPhk.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\VERSION.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\NTDLL.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\DDRAW.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\NVARCH32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\NVOPENGL.DLL'', no matching symbolic information found.
The thread 0xFFFBCB9D has exited with code 0 (0x0).
The program ''C:\Windows\Desktop\Debug\Lesson8.exe'' has exited with code 0 (0x0).
Thank you
Waldoo
Loaded ''C:\WINDOWS\SYSTEM\DCIMAN32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\GLU32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\CRTDLL.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\OPENGL32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\ADVAPI32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\GDI32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\USER32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\KERNEL32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\PGPhk.dll'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\VERSION.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\NTDLL.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\DDRAW.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\NVARCH32.DLL'', no matching symbolic information found.
Loaded ''C:\WINDOWS\SYSTEM\NVOPENGL.DLL'', no matching symbolic information found.
The thread 0xFFFBCB9D has exited with code 0 (0x0).
The program ''C:\Windows\Desktop\Debug\Lesson8.exe'' has exited with code 0 (0x0).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement