🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #584

I keep getting "ld: Undefined symbol ___main" errors

#584
From: Vince Tessier
Date: Sun, 08 Nov 1992 23:14
34 lines
1744 bytes
Mea culpa, mea maxima culpa ...

I violated a cardinal rule by zapping something before its replacement
was proven, and now I can't compile anything with gcc.

I used to run gcc-2.2.1 just fine on my sparc.  Then I built 2.2.2, and
within a couple of days 2.3.1, configuring with 

	./configure --target=sparc-sun-sunos4.1.1 --with-gnu-ld

The entire build and install process went just fine, compiling the
compiler with itself, installing fixincludes, and so on.  But every time
I try to build another package, I can compile the object modules, but
when I go to link the executable, I get a message of the form

	main.o(.text+4): undefined reference to `___main' 

If I build without the "--with-gnu-ld" option and make 'collect2' to
call Sun ld, I get 

	ld: Undefined symbol ___main 
	collect: /usr/bin/ld returned 2 exit status

Of course, I zapped my old gcc-2.2.1 after 2.2.1 and later 2.3.1 built,
compared, and installed without problems; I don't recall how I had
set 2.1.1 up (a while ago).

I've looked through INSTALL, README, the info files, and browsed the
sources for gcc and ld, and can't seem to find where I've gone wrong.

-- 
Vince Tessier	vtessier@vela.acs.oakland.edu

"Think global, act loco."  -- Zippy
Technical Details
Message-ID: <vtessier.721264495@vela>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!wsu-cs!vela!vela!vtessier

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!wsu-cs!vela!vela!vtessier
From: vtessier@vela.acs.oakland.edu (Vince Tessier)
Subject: I keep getting "ld: Undefined symbol ___main" errors
Message-ID: <vtessier.721264495@vela>
Summary: I screwed up a search/load path somewhere, but where?
Keywords: gcc-2.3.1 sparc sunos4.1.1
Organization: Oakland University, Rochester MI.
Date: Sun, 8 Nov 1992 23:14:55 GMT
Lines: 34