error LNK2001: unresolved external symbol _WinMain@16

Hello everyone,

I have this problem I don't seem to get out. I'm using VC++ 6.0 on an XP PC.
Compiling my program, existing of 3 headers and 1 cpp, I don't get any errors nor warnings.
However, when I'm trying to build I get the following :


Linking...
MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
Release/Wsp.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.


As a starter, I admit I have near to no knowledge of what exactly I should put as in what settings I should use for this Projects, I'm assuming I have this project changed under "Using MFC as Shared DLL"; This is an "empty" Win32 Application.
To be honest with you I don't get a lot out of what I'm doing on those Project settings yet..it's a bit too new to me. Yet I'm thinking this lack of knowledge has something to do with my error here..therefore would anyone explain me what to do and why it's acting like that?  From what I'm making out of this : the file _WinMain@16 is not available in the library MSVCRT? or should I put a library directory somewhere in those project settings? I'm completely in the dark..
Thank you in advance..

Dixie
TraveldixieAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mnashadkaCommented:
If it has int main() or void main() as the entry point, make sure that it uses the console subsystem.  If you use int WINAPI WinMain() as the entry point, use the windows subsystem.  I'm betting that you want the console subsystem.  To change this, go to Project->Settings->Link and change it to /subsystem:console in the Project Options box at the bottom.  Good luck.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TraveldixieAuthor Commented:

I have a void main().
so if I understand this well..My choice of making a Win32 Application in the beginning of my project was wrong and should've been Win32 Console application, right?
Would you be so kind as to generally explain the difference between the two? Has it do to with GUI - preferences? Just trying to get myself an idea already..
But anyhow, thank you a lot for such quick response..it did take error away..

0
mnashadkaCommented:
A Win32 application by default has no window.  When you double-click it, it starts running, and has windows if it creates them (like a standard windows application - Word or Excel or whatever).  It has a predefined entry point named WinMain.  This is great if you have a backgroundA console application by default has a console window (and can also create it's own windows if needed).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.