Advertisement

opengl hates me!

Started by July 08, 2002 03:12 PM
9 comments, last by clarionhaze 22 years, 7 months ago
Whenever I try to compile the tutorials I got straight from NEHE I get these following link errors.... can someone please tell me how to fix this? --------------------Configuration: Lesson1 - Win32 Debug-------------------- Linking... Lesson1.obj : error LNK2001: unresolved external symbol _gluPerspective@32 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 __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 Debug/Lesson1.exe : fatal error LNK1120: 15 unresolved externals Error executing link.exe. Lesson1.exe - 16 error(s), 0 warning(s) -Steve
Have you set up your include and library files correctly?
I tried to code, but the compiler kept giving me an error: stupid coder alert.hpotter2
Advertisement
You need to link opengl32.lib and glu32.lib to your project.

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.
Have you set up your include and library files correctly?
I tried to code, but the compiler kept giving me an error: stupid coder alert.hpotter2
After properly linking OpenGL32.lib GLu32.lib and GLaux.lib I know get the following error.

--------------------Configuration: Lesson3 - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Lesson3.exe - 2 error(s), 0 warning(s)


Anymore ideas???

-Steve
Create your project in MSVC as a console app and not a windows app.
Advertisement
to change it to console i made winmain into main() with no arguments... however the same errors occur...

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

Lesson3.exe - 2 error(s), 0 warning(s)

-Steve
to change it to console i made winmain into main() with no arguments... however the same errors occur...

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

Lesson3.exe - 2 error(s), 0 warning(s)

-Steve
http://www.gamedev.net/community/forums/topic.asp?topic_id=71865
http://www.gamedev.net/community/forums/topic.asp?topic_id=64030
http://www.gamedev.net/community/forums/topic.asp?topic_id=57362
http://www.gamedev.net/community/forums/topic.asp?topic_id=46617
http://www.gamedev.net/community/forums/topic.asp?topic_id=29078
http://www.gamedev.net/community/forums/topic.asp?topic_id=13309
http://www.gamedev.net/community/forums/topic.asp?topic_id=78611
http://www.gamedev.net/community/forums/topic.asp?topic_id=71741
http://www.gamedev.net/community/forums/topic.asp?topic_id=31401
http://www.gamedev.net/community/forums/topic.asp?topic_id=95205

In short answer, change main back to WinMain and then do this:
1) Go to Project->Settings
2) Go to the Link tab and select "General"
3) In the box titled "Project Options," change "/subsystem:console" to "/subsystem:windows". If there is no "/subsystem" switch, simply add "/subsystem:windows".

Tada.

Peace,
ZE.

P.S. Never blame the software for your own ignorance.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

Thank you very much ZE.

-Steve

ps
sorry for noob questions :-\

This topic is closed to new replies.

Advertisement