Link to home
Start Free TrialLog in
Avatar of pdw
pdw

asked on

LNK2001: undefined external "_main"

Whenever I try to build the example WSOCK from the MS VC++ v4.2 samples\SDK\WIN32 folder, it will not link, claiming that "_main()" is undefined.  I have followed the instructions for building a multithreaded application in the help file, which involves including the LIBCMT.LIB library, which would appear to cause this problem.  As a windows program, there is no main() function, just a WinMain() function.
How do I avoid/get around this problem?
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdw
pdw

ASKER

Thanks for the reply.  I did manage to get it to link by constructing the project from the makefile, and from this I figured out what on the linker command line was wrong - for some reason it had decided that this was a console app.  doh!  I'm new to VC.....

Thanks!