473,507 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

meaning of the error ?

Dear All

While building the the project,
I am geting the two errors at linking stage.

Can any help me out what these exactly means ??

Linking...
Creating library Debug/15JulyBulid.lib and object
Debug/15JulyBulid.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/15JulyBulid.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

15JulyBulid.exe - 2 error(s), 0 warning(s)

Thanks In Advance
Ranjeet

Nov 15 '05 #1
12 1595
ra***********@gmail.com wrote on 15/07/05 :

While building the the project,
I am geting the two errors at linking stage.

Can any help me out what these exactly means ??

Linking...
Creating library Debug/15JulyBulid.lib and object
Debug/15JulyBulid.exp
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/15JulyBulid.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

15JulyBulid.exe - 2 error(s), 0 warning(s)


Sounds not to be a C-queston. More likely it's a compiler/linker issue.
You should read more carefully your compiler/linker manual about 'how
to make a library' or 'how to make an executable' depending what you
want to do exactly.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"There are 10 types of people in the world today;
those that understand binary, and those that dont."

Nov 15 '05 #2
Ken
Hi Ranjeet,

Frankly, It's only one error.

I have a quesition. What type of application do you want to build?
executive or library?

It seems like you are building a library but you choosed wrong
application type.

Ken

Nov 15 '05 #3
ra***********@gmail.com writes:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main


Your C program does not contain a function named main().
Every portable C program must.
--
Ben Pfaff
email: bl*@cs.stanford.edu
web: http://benpfaff.org
Nov 15 '05 #4
Groovy hepcat Ben Pfaff was jivin' on Sat, 16 Jul 2005 16:40:06 -0700
in comp.lang.c.
Re: meaning of the error ?'s a cool scene! Dig it!
ra***********@gmail.com writes:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main


Your C program does not contain a function named main().
Every portable C program must.


Every portable C program in a hosted environment, that is.

--

Dig the even newer still, yet more improved, sig!

http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
Nov 15 '05 #5
ph******@alphalink.com.au.NO.SPAM (Peter "Shaggy" Haywood) writes:
Groovy hepcat Ben Pfaff was jivin' on Sat, 16 Jul 2005 16:40:06 -0700
ra***********@gmail.com writes:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main


Your C program does not contain a function named main().
Every portable C program must.


Every portable C program in a hosted environment, that is.


There are no portable C programs in freestanding environments.
For example, in a freestanding environment there is no way to
predict the name of the program startup function.
--
Ben Pfaff
email: bl*@cs.stanford.edu
web: http://benpfaff.org
Nov 15 '05 #6
i've tried to build some code which don't have a main function.
yes ,it proves u're right.
but i heard someone said that the c program sometimes can run without a
main function .then what is that?

Nov 15 '05 #7
In article <11**********************@o13g2000cwo.googlegroups .com>,
vire <Av*****@gmail.com> wrote:
i've tried to build some code which don't have a main function.
yes ,it proves u're right.
but i heard someone said that the c program sometimes can run without a
main function .then what is that?


Troll.

Nov 15 '05 #8
Ben Pfaff <bl*@cs.stanford.edu> wrote:
ra***********@gmail.com writes:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main


Your C program does not contain a function named main().
Every portable C program must.


Really? I wonder, if a program doesn't have `main', is it UB, or CV?
Which rule is violated?

[always assuming hosted implelementation]

--
Stan Tobias
mailx `echo si***@FamOuS.BedBuG.pAlS.INVALID | sed s/[[:upper:]]//g`
Nov 15 '05 #9
Le mardi 19 juillet 2005 à 08:57, vire a écrit dans comp.lang.c*:
i've tried to build some code which don't have a main function.
yes ,it proves u're right.
but i heard someone said that the c program sometimes can run without a
main function .then what is that?


The important word in Ben's answer was "portable".

Non-portable programs may run without a main() function if there is an
alternative in their environment (like WinMain() in Windows, for
instance).

Note: to answer properly with Google, don't click Reply, click Show
Options and then click the Reply that appears among those options.

--
___________ 19/07/2005 09:49:59
_/ _ \_`_`_`_) Serge PACCALIN -- sp ad mailclub.net
\ \_L_) Il faut donc que les hommes commencent
-'(__) par n'être pas fanatiques pour mériter
_/___(_) la tolérance. -- Voltaire, 1763
Nov 15 '05 #10
"S.Tobias" <si***@FamOuS.BedBuG.pAlS.INVALID> wrote:
Ben Pfaff <bl*@cs.stanford.edu> wrote:
ra***********@gmail.com writes:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Your C program does not contain a function named main().
Every portable C program must.


Really? I wonder, if a program doesn't have `main', is it UB, or CV?


What is CV? (Except Curriculum Vitae, which hardly seems to apply here;
Curriculum Programmis would be more appropriate...)
Which rule is violated?


5.1.2: "program startup occurs when a designated C function is called by
the execution environment"; and 5.1.2.2.1#1: "The function called at
program startup is named main". Since there is, AFAICT, no clause
defining what happens if a function is called which was not actually
defined in the program[1], running a program which doesn't define main()
in a hosted environment has undefined behaviour.

Richard

[1] Which is quite possible even for other functions: link an executable
using a dynamic library, then remove that library, for example.
Nov 15 '05 #11
Richard Bos <rl*@hoekstra-uitgeverij.nl> wrote:
"S.Tobias" <si***@FamOuS.BedBuG.pAlS.INVALID> wrote:

Really? I wonder, if a program doesn't have `main', is it UB, or CV?


What is CV? (Except Curriculum Vitae, which hardly seems to apply here;
Curriculum Programmis would be more appropriate...)


"Constraint violation". I thought people had used this abbreviation here.
Which rule is violated?


5.1.2: "program startup occurs when a designated C function is called by
the execution environment"; and 5.1.2.2.1#1: "The function called at
program startup is named main". Since there is, AFAICT, no clause
defining what happens if a function is called which was not actually
defined in the program[1], running a program which doesn't define main()
in a hosted environment has undefined behaviour.
[1] Which is quite possible even for other functions: link an executable
using a dynamic library, then remove that library, for example.


I see, so its UB by omission of definition, and the compiler/linker
is not required to diagnose lack of `main'.

Thank you.

--
Stan Tobias
mailx `echo si***@FamOuS.BedBuG.pAlS.INVALID | sed s/[[:upper:]]//g`
Nov 15 '05 #12
"S.Tobias" <si***@FamOuS.BedBuG.pAlS.INVALID> wrote:
Richard Bos <rl*@hoekstra-uitgeverij.nl> wrote:
"S.Tobias" <si***@FamOuS.BedBuG.pAlS.INVALID> wrote:

Really? I wonder, if a program doesn't have `main', is it UB, or CV?


What is CV? (Except Curriculum Vitae, which hardly seems to apply here;
Curriculum Programmis would be more appropriate...)


"Constraint violation". I thought people had used this abbreviation here.


Ah. Well, a constraint violation, if the compiler lets you get away with
it, automatically means UB as well. But no, it does not require a
diagnostic, as far as I can see.

Richard
Nov 15 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2364
by: Roman Simkin | last post by:
Hi, As far as I know, a static variable is a variable that belongs to a function or a class (are there any other options?). I've seen somewhere a function that *returns* static types - something...
5
10388
by: Steve | last post by:
Hi; I went to the microsoft site to try to find a guide to the error messages that the jdbc drivers give ( for sqlserver 2000 ). I had no luck. Does anyone know if there is such a guide? ...
3
1827
by: Alexander Farber | last post by:
Hi, does anyone have an idea, why do I get the following error (I have to use g++296 on RedHat Linux as compiler): In file included from r_dir.cpp:9: r_obey.h:262: declaration of `const...
5
7194
by: vilhelm.sjoberg | last post by:
Hello, I am a resonably confident C programmer, but not very sure about the dark corners of C++. Recently, I had G++ give me a strange error. The program in question is in essence: struct...
388
21410
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's...
1
1358
by: mar-kav | last post by:
Hello, i'm a beginner so exuse me: i installed IIS 5.1, Framework1.1, vs .NET 2003 i put my web dir' in inetpub/wwwroot, tried to broows to my homepage under localhost & got this error message: ...
87
5024
by: Robert Seacord | last post by:
The SEI has published CMU/SEI-2006-TR-006 "Specifications for Managed Strings" and released a "proof-of-concept" implementation of the managed string library. The specification, source code for...
2
3080
by: Jimmy | last post by:
The following is apart of db2diag file. 2006-10-11-19.03.36.005000 Instance:DB2 Node:000 PID:3440(tomcat5.exe) TID:844 Appid:none oper system services sqloSSemClose Probe:20 ...
2
10985
by: excite | last post by:
I am trying to write a long string into a txt file, the string includes some backslash, looks like: 'd:\#########\#######\####### d:\######\####\####\### d:\###\###\' then I got a error saying...
0
7223
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,...
0
7111
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...
0
7319
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,...
0
7376
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...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
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,...
0
3191
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...
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.