• Advertisement

Archived

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

Help me!

This topic is 5857 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

Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Starfield.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Starfield.exe - 2 error(s), 0 warning(s) I get that message many times when I compile my progra in Visual C++ 6. Why?

Share this post


Link to post
Share on other sites
Advertisement
Because you set your project to be a console application (for with main() is the entry point) instead of a windows application (for which WinMain() is the entry point).

Edited by - Fruny on February 3, 2002 5:19:34 AM

Share this post


Link to post
Share on other sites
Yep, remember when you create a new project select Win32 application. Not win32 MFC application though.

Share this post


Link to post
Share on other sites
The solution has already been posted. Start a new project, making sure you select "Win32 Application" (NOT Win32 Console Application - they are right next to each other so it is easy to click the wrong one by mistake) and add your files to the project.

Share this post


Link to post
Share on other sites
Or must you learn how to use it?

Sorry but if it''s looking for a main, then you specified your project to be a console application.

I doubt VS could mess up with its projects definition to the point of mixing win32 console and plain win32...

"Do it with style or don''t bother doing it."

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Alright,

Problem #1: You''ve made a program. It contains a function called main(). You try to compile it and get a unresolved external WinMain().

Solution #1: You created a Windows 32 Application, a program that contains the main() function needs to be a console application.

Problem #2: You''ve made a program, it contains a function called WinMain(). You try to compile and get a unresolved external main().

Solution #2: You created a windows 32 console application. A program that constains the WinMain() function needs to be a Windows 32 application for it to compile.


The answer to your problem is listed above. DO NOT KEEP CREATING THE SAME PROJECT OVER & OVER AGAIN!. There are 2 project types you must be aware of Win32 Console Application and Win32 Application. These two projects are NOT THE SAME.

Share this post


Link to post
Share on other sites

  • Advertisement