Jump to content
  • Advertisement
Sign in to follow this  
deepBlue

OpenGL LINKING PROPLEM LEASON 1

This topic is 4696 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I try to compile leason 1 on VC++ 6 and the fallowing happen Compiling... Lesson1.cpp 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. Results Lesson1.exe - 16 error(s), 0 warning(s) and i read in some thread that i should do #pragma comment( lib, "opengl32.lib" ) #pragma comment( lib, "glu32.lib" ) #pragma comment( lib, "vfw32.lib" ) but still Output Window Compiling... Lesson1.cpp Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Lesson1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Results Lesson1.exe - 2 error(s), 0 warning(s) PLEASE HELP

Share this post


Link to post
Share on other sites
Advertisement
Hey bud,

The cause of this error:

error LNK2001: unresolved external symbol _main

is likely because you have created a new project set up for a console application, one where you have int main( int argc, char* argv[] ). But instead you either don't have that main or you have the WIN32 main, which is different. Now in Visual Studio if you go to the project options/settings and look at the Link->System tab there is an option called subsystem that allows you to choose what style of build to use. Change it to console.

Hope that helps,

ace

Share this post


Link to post
Share on other sites
Sorry... but I just got to say it.

Linking Proplem Leason 1.


lol. :)

Sorry if I'm being rude, but I see this crazy chinese guy in my head when I'm reading that sentence...


Peace!

Share this post


Link to post
Share on other sites
No, I really don't consider that rude, I consider that a wakeup call. Anyone who gets a linking problem as specific as the one above, and doesn't know what it means is clearly starting to program with opengl, instead of learning programming and then learning the OpenGL API. In my opinion, this is an impatient and unwise way to do things. Personally, I think people should learn all the basics first rather than copy and pasting code from something clearly above their head and hoping it works.

Also, I think it would be wise for people to actually think when reading errors.
Lets look at this one example: "Lesson1.obj : error LNK2001: unresolved external symbol _gluPerspective@32" Well, from that error, we can gather three things, one is that something is unresolved (doesn't exist) another is that it is the function gluPerspective that doesn't exist, and lastly that this is a problem with the linking stage of the compiler. I think it is pretty obvious that you aren't include the library that contains the gluPerspective function from that.

I am not trying to be mean to newbies or anything of that sort, I just think that they would be alot better off if they started with the basics, and worked their way up to things more complex.

Share this post


Link to post
Share on other sites

This topic is 4696 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!