473,385 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

..and now it doesnt compile?

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
5 1850

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

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
* 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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sachin bond | last post by:
The following code(in c++) is supposed to divide a file into 'n' different files. suppose i'm having a file called "input.zip". The execution of the following code should divide "input.zip"...
21
by: Stephan | last post by:
why does the following code not work???? after compiling and running it will just say killed after all my memory filled up any suggestions? #include <iostream> using namespace std; void...
1
by: bluekite2000 | last post by:
In class Matrix, I rather have just virtual T& operator () (int i, int j) { } since virtual T& operator () (int i, int j) { } and
5
by: Lasse Edsvik | last post by:
Hello Im trying to do a simple page with data from my local sql server, and page just shows up blank...... I created a stored procedure with SELECT * FROM Employees...... whats wrong? ...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
1
by: Jozsef Bekes | last post by:
Hi All, I need to derive a class in VB.Net from a COM interface declared in an idl file in a VC++ project. Here is the interface declaration:...
9
by: nichas | last post by:
I tried to use #include<iostream> in visual C++ compiler but then it didnt work but i see this is the way it is being mentioned in C++ primer by lippman and lajoie.. where is the problem.. Do...
1
by: hkma08 | last post by:
I dont know I should post JSP error in here or not. If not please redirect me to another one. Thx. I just installed apache tomcat with mysql with java, but i got error when try to connect to mysql...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.