Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unresolved external symbol _main

Status
Not open for further replies.

ForeverCode

Programmer
Dec 6, 2002
41
0
0
US
When i try to rebuild i get this:

msvcrt.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

Does anyone know what I need to do to fix this?? I'm kinda stuck here until I am able to rebuild my project:(

-Micah
 
If you're building a dll or a Win32 app, there's no main. I suspect you're linking with the library that's used to build console apps, which assumes you DO have a main. I don't remember the correct library off the top of my head, but that's the core of your problem.

Rose/Miros
 
Well, I can't quite remember how I started this project, but basically I made a new project(could have been a console app) and deleted EVERYTHING. Then I put in my own code to generate a window, buttons, and lables. Then to handle events and such. I had to mess around with the projects settings to get it working:) For some reason a week or so after I had done that I rebuilt the project and I got that error. I was however able to fix it. I just coppied the project settings file from my backup and it worked. I dont know why because I hadn't changed anything in the project's settings since I started.
 
You're very brave... I make sure I create the project as close as possible to what I'm going to do, then modify the libraries that get linked in one at a time, testing each change...

Rose/Miros
 
check you compiler settings "/MD, /ML, /MT, /LD" that include run-time libraries into your project "behind your back", compare with you needs ( you could consult search for msvcrt.lib)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top