Article View: gnu.gcc.help
Article #592Re: I keep getting "ld: Undefined symbol ___main" errors
From: Andreas Manessinger
Date: Mon, 09 Nov 1992 15:21
Date: Mon, 09 Nov 1992 15:21
21 lines
1433 bytes
1433 bytes
>>>>> On Sun, 8 Nov 1992 23:14:55 GMT, vtessier@vela.acs.oakland.edu (Vince Tessier) said:
Vince> when I go to link the executable, I get a message of the form
Vince> main.o(.text+4): undefined reference to `___main'
`_main' is a symbol from `libgcc.a' that is automatically linked,
whenever you call `gcc' for linking. I believe that whenever you have
compiled the file that contains the function `main()', you have to
link using `gcc' or by issuing
`cc -o foo foo.o bar.o /usr(local/lib/gcc-lib/sun4/2.3.1/libgcc.a'
or wherever you have that library.
Hope that helps
--
/\ | eMail: man@magwien.gv.at (Andreas Manessinger)
/ \ndreas | pMail: Alserstra"se. 20/6; A-1090 Wien; Austria
/\/\ \ | Work : Gemeinde Wien MD-ADV/Ma; Ref. EPS
/ / \anessinger | Phone: +43 222 4039584/13, FAX: 4039584/18, Home: 9350434
Technical Details
Message-ID:
<MAN.92Nov9162140@imrryr.at>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!doc.ic.ac.uk!uknet!mcsun!hp4at!xs0001!newsReferences:
<vtessier.721264495@vela>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!doc.ic.ac.uk!uknet!mcsun!hp4at!xs0001!news From: man@magwien.gv.at (Andreas Manessinger) Newsgroups: gnu.gcc.help Subject: Re: I keep getting "ld: Undefined symbol ___main" errors Message-ID: <MAN.92Nov9162140@imrryr.at> Date: 9 Nov 92 15:21:45 GMT References: <vtessier.721264495@vela> Sender: news@xs0001.at (USENET News System) Organization: Gemeinde Wien, MD-ADV/Md Ref. EPS Lines: 21 In-Reply-To: vtessier@vela.acs.oakland.edu's message of Sun, 8 Nov 1992 23:14:55 GMT Nntp-Posting-Host: imrryr