Visual C++ Problem

Started by
4 comments, last by Feblex 22 years, 1 month ago
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?
Advertisement
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
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.
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.
-------------------------------------------------------BZZZZTT - CRASH - BANG"What was that?!""Captain, it appears that we have encountered a strange sub-space anomaly. I'm getting a high reading of tracheons beams. The anomaly seems to be some kind of rift in the space-time continuum. -- Never mind, Bones was just using the microwave again."
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.
daerid@gmail.com
To prevent this problem in the future, when you''re creating a project, create a Win32 Application and not a Console Application, if it''s a Windows program.

~CGameProgrammer( );

~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.

This topic is closed to new replies.

Advertisement