Archived

This topic is now archived and is closed to further replies.

Unresolved externals :(

This topic is 5841 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 had it solved once... but I forgot what I did... lost the project that I fixed it with... so I don't know what to do.. I have everything I need included, and I linked glu32.lib, glaux and opengl32 .lib.... But I always get this error when building (compiles fine): Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/robot.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. no idea what is wrong... Edited by - Tantalus on December 9, 2001 11:45:15 AM

Share this post


Link to post
Share on other sites
When creating a project, be careful with what kind of project you choose. A "Win32 Application" uses WinMain for entry point, a "Win32 Console Application" uses main for entry point.

Your code probably has a WinMain, while you created a console application, which requires a main instead. Therefore the linker complains when it cannot find main.

Share this post


Link to post
Share on other sites
When I do daily builds at work, and I get that error message, it usually means that I need to do a full rebuild, instead of the "changed-files only" build which is the default in VC++.

In Visual C++, go to Build->Rebuild All.

RomSteady - Able to leap off tall buildings in a single bound

Share this post


Link to post
Share on other sites
I'm not going to ask you what you did; rather, I'm going to tell you what you did and how to avoid such in the future.

You wrote your code as a proper Win32 app - WinMain and all. You probably hit compile and got that popup message about requiring a workspace, and you said yes. Mistake. Saying yes causes MSVC to create a Win32 console application rather than a Win32 application. It is possible to change from one to the other by modifying some settings, but I forget which. Easiest thing to do is to create a new project workspace and be sure to choose Win32 Application as its type. You can even add the new project workspace to the existing one, so you can build a console app to test specific little routines and a full-fledged Win32 app as your final product.

Taking a few extra minutes to ensure your environment is set up properly every time can be a huge help.

[edit:] Oops, forgot the smiley! People might actually think I'm serious!

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!


Edited by - Oluseyi on December 13, 2001 7:36:17 PM

Share this post


Link to post
Share on other sites