..and now it doesnt compile?

T

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??


Any help will prevent me losing the rest of my hair.


TIA
 
J

Jaspreet

TreatmentPlant said:
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/ShowPost.aspx?PostID=14021&SiteID=1
 
J

Jaspreet

TreatmentPlant said:
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
 
A

Alf P. Steinbach

* 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'.
 
T

TreatmentPlant

Alf said:
* TreatmentPlant:



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.
 
R

Richard Herring

Alf P. Steinbach said:
* TreatmentPlant:

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top