473,796 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
1684
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" into 'n'(user specified) different files. However the code currently..though makes 'n' different files... the divided contents are stored only in the first of the 'n' files.
21
7288
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 out_of_mem() {
1
1227
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
1248
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? using System;
8
7838
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 VALUE ENTERED BY THE USER EXISTS IN THE DB , then THE ERROR MESSAGE OF THE COMPARE VALIDATOR SHOULD BE DISPLAYED. For this, I used the reference artiicle "http://msdn.microsoft.com/library/default.asp?url=/library/en-...
1
2039
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: ----------------------------------------------------- interface IParameter : IDispatch { HRESULT _stdcall ID( long* );
9
6178
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 reply please.
1
3373
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 database, what is happening? Here is my error msg: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 3 in the jsp file: /tutorial/test.jsp Syntax error on tokens, delete these tokens 1: <%@ page...
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.