Archived

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

Tantalus

Unresolved externals :(

Recommended Posts

Tantalus    122
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
Brother Bob    10344
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
Zeusel    122
isnt winmain called by main? you are probaly using sdl, i had that problem too! be sure your arguments of main are correct: main(i dont know what but it has to be correct);

Share this post


Link to post
Share on other sites
RomSteady    248
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
Oluseyi    2103
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