By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 1,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

..and now it doesnt compile?

P: n/a
Very late last night I was working on a project. When I left it - it
worked and all was sweet!

After a nap I came back to it this morning to find that the project will
not compile and I keep getting this error:

-----------------Configuration: take2 - Win32 Debug--------------------
Linking...
Creating library Debug/take2.lib and object Debug/take2.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/take2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
take2.exe - 2 error(s), 0 warning(s)
The only changes I had made to the project were to add more comments and
changed one variable in one routine from *x to *y. I tried changing
these back but it didn't work either.

By hook and by crook I cannot find has what has changed or what causes
this error??
Any help will prevent me losing the rest of my hair.
TIA
Apr 12 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

TreatmentPlant wrote:
Very late last night I was working on a project. When I left it - it
worked and all was sweet!

After a nap I came back to it this morning to find that the project will
not compile and I keep getting this error:
Try going back to the previous backup.

-----------------Configuration: take2 - Win32 Debug--------------------
Linking...
Creating library Debug/take2.lib and object Debug/take2.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/take2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
take2.exe - 2 error(s), 0 warning(s)
The only changes I had made to the project were to add more comments and
changed one variable in one routine from *x to *y. I tried changing
these back but it didn't work either.

By hook and by crook I cannot find has what has changed or what causes
this error??
Any help will prevent me losing the rest of my hair.
TIA


http://www.mvps.org/vcfaq/lang/5.htm

Try posting this to a microsoft specific group. I am not sure but would
the following link help ?

http://forums.microsoft.com/MSDN/Sho...14021&SiteID=1

Apr 12 '06 #2

P: n/a

TreatmentPlant wrote:
Very late last night I was working on a project. When I left it - it
worked and all was sweet!

After a nap I came back to it this morning to find that the project will
not compile and I keep getting this error:

-----------------Configuration: take2 - Win32 Debug--------------------
Linking...
Creating library Debug/take2.lib and object Debug/take2.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/take2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
take2.exe - 2 error(s), 0 warning(s)

<snip>

http://support.microsoft.com/?scid=kb;en-us;894573

Apr 12 '06 #3

P: n/a
* TreatmentPlant:
Very late last night I was working on a project. When I left it - it
worked and all was sweet!

After a nap I came back to it this morning to find that the project will
not compile and I keep getting this error:

-----------------Configuration: take2 - Win32 Debug--------------------
Linking...
Creating library Debug/take2.lib and object Debug/take2.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/take2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
take2.exe - 2 error(s), 0 warning(s)
The only changes I had made to the project were to add more comments and
changed one variable in one routine from *x to *y. I tried changing
these back but it didn't work either.

By hook and by crook I cannot find has what has changed or what causes
this error??


Here are two probable causes:

1 You have removed the file defining 'main' from your build,
and/or commented out the 'main' function.

2 You have previously used a Microsoft non-standard startup
function such as 'WinMain', and have changed the build settings
to require a standard 'main' function.

For case (1), undo your changes.

For case (2), one "practical" fix is to revert the build settings to
Microsoft non-standard behavior, keeping your code as-is (non-standard),
and a better fix is to change the startup function to standard 'main'.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Apr 12 '06 #4

P: n/a
Alf P. Steinbach wrote:
* TreatmentPlant:
Very late last night I was working on a project. When I left it - it
worked and all was sweet!

After a nap I came back to it this morning to find that the project
will not compile and I keep getting this error:

-----------------Configuration: take2 - Win32 Debug--------------------
Linking...
Creating library Debug/take2.lib and object Debug/take2.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/take2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
take2.exe - 2 error(s), 0 warning(s)
The only changes I had made to the project were to add more comments
and changed one variable in one routine from *x to *y. I tried
changing these back but it didn't work either.

By hook and by crook I cannot find has what has changed or what causes
this error??

Here are two probable causes:

1 You have removed the file defining 'main' from your build,
and/or commented out the 'main' function.

2 You have previously used a Microsoft non-standard startup
function such as 'WinMain', and have changed the build settings
to require a standard 'main' function.

For case (1), undo your changes.

For case (2), one "practical" fix is to revert the build settings to
Microsoft non-standard behavior, keeping your code as-is (non-standard),
and a better fix is to change the startup function to standard 'main'.

Thanks all for you input.

I managed to fix the problem - - I just don't know how I did (or undid) it!

It works. I am happy.
Thanks again.
Apr 12 '06 #5

P: n/a
In message <4a************@individual.net>, Alf P. Steinbach
<al***@start.no> writes
* TreatmentPlant:
Very late last night I was working on a project. When I left it - it
worked and all was sweet!
After a nap I came back to it this morning to find that the project
will not compile and I keep getting this error:
-----------------Configuration: take2 - Win32
Debug--------------------
Linking...
Creating library Debug/take2.lib and object Debug/take2.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/take2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
take2.exe - 2 error(s), 0 warning(s)
The only changes I had made to the project were to add more
comments and changed one variable in one routine from *x to *y. I
tried changing these back but it didn't work either.
By hook and by crook I cannot find has what has changed or what
causes this error??
Here are two probable causes:

1 You have removed the file defining 'main' from your build,
and/or commented out the 'main' function.

2 You have previously used a Microsoft non-standard startup
function such as 'WinMain', and have changed the build settings
to require a standard 'main' function.

3 Something changed the focus in your IDE, causing you to accidentally
type a single character right at the top of a very long header file,
which has subtly changed the meaning of everything that follows. I've
lost count of the number of times this one has bitten me.
For case (1), undo your changes.

For case (2), one "practical" fix is to revert the build settings to
Microsoft non-standard behavior, keeping your code as-is
(non-standard), and a better fix is to change the startup function to
standard 'main'.


--
Richard Herring
Apr 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.