home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / gcc / help / 2484 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.4 KB

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