Archived

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

Visual C++ Problem

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

Okay, I''ve taken the step to use Visual C++, and I keep getting this error: LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Lesson6.exe : fatal error LNK1120: 1 unresolved externals This seems like a common problem, but I''ve never seen a solution! Any ideas?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What have you tried so far?

The only solution I can think of is to make sure your project is a Win32 application. Even if you THINK it is, sometimes those little project icons can fool you

Share this post


Link to post
Share on other sites
I''ve tried everything I can think of- changing the Winmain thing to Main, Win_Main, etc. I KNOW it is a Win32 Application because I selected "Win32 Application" and chose "Empty Project". I also tried Nehe''s downloadable code, but nothing works.

Share this post


Link to post
Share on other sites
Sorry, I have never heard of this problem. i got VC++ a month ago and everything works fine. Make sure that not only do you select "Win32 Application" but that the Win32 check box under the Platforms heading is checked.

Try going to the Project|Settings... menu, click the Link tab and see if you see the following in the Object/library modules text box:

kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Also look for the following somewhere in the Project Options:
/subsystem:windows

If they aren''t there even though you are sure you emphatically told VC++ that is was a Win32 program, then I guess something could be wrong with new project generator.

Share this post


Link to post
Share on other sites
Go To Project->Settings and click the link tab

In the bottom window, where it shows all the project options,

make sure that you have something that says:

/subsystem:windows

if it says /subsystem:console, change it.

Then you need to make sure that you have a WinMain() function in your code.

Share this post


Link to post
Share on other sites