🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50271

how to link gcc object with g++ code

#50271
From: Larry Tsui
Date: Mon, 08 Nov 1993 18:25
28 lines
1252 bytes
Folks,

I have a tough time linking object code (generated by gcc) with g++.

For an example, let's say 1.c is written in c and 2.c is written in
c++.  The following is ok:
		g++ 1.c 2.c

However, the following comes back with an error:
		gcc -c 1.c
		g++ 1.o 2.c

ld: Undefined symbol
   _foo__Fv


foo() is the name of the function defined in 1.c and used in 2.c; my
envirnoment is SunOS4.1.2, gcc 2.4.5 and libg++ 2.4.

Do I need some command line options or do I need other GNU stuff
(e.g. gnu ld, glibc)?  Thanks for any information!

Regards,

Larry
--
Larry Tsui
email: tsuil@tord0.gs.com		voice:(416)-343-8824
Technical Details
Message-ID: <TSUIL.93Nov8132525@tor01.fi.gs.com>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!fi.gs.com!netnews!tsuil

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,8d79ca16c4a072fa,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-11-08 11:25:26 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!fi.gs.com!netnews!tsuil
From: tsuil@tor01.fi.gs.com (Larry Tsui)
Subject: how to link gcc object with g++ code
Message-ID: <TSUIL.93Nov8132525@tor01.fi.gs.com>
Sender: news@fi.gs.com (Netnews Administrator)
Nntp-Posting-Host: tor01.fi.gs.com
Organization: Goldman, Sachs & Co
Date: Mon, 8 Nov 1993 18:25:25 GMT
Lines: 28