🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3396

Re: CC compiled .so does not work with g++ compiled main program

#3396
From: Brian Reynolds
Date: Wed, 23 Dec 1998 00:00
47 lines
1922 bytes
I am trying to develop a shared library (.so) on Solaris to extend a

program, but it will not load. 



We have boiled down the problem to an incompatability between the g++

and CC compilers. The main program is a C++ program compiled with g++.

For certain reasons, I need to compile my shared library with CC though.

If I do compile the library with g++ (compile ".o"s using -g and -fPIC

options, and linking with -shared option) it works, but if change to

Sun's CC compiler and compiler (compile ".o"s with -g and -PIC, link

with -G option) the module can no longer load; that is, the main program

can not call any of the functions in the library.



Something that makes this problem a bit easier is that the functions in

the library that must be called by the main program are c functions that

in turn call c++ functions. This at least keeps me from having to deal

with the name mangling problems that I know are an incompatability

between the two compilers. 



Does anyone have information on what I would need to do to get a c++

library compiled with CC to be loaded from a main program compiled with

g++? 



Brian

brian.reynolds@iai.com
Technical Details
Message-ID: <36814BCA.4A78@iai.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc89c,880e20546d838090
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 10ba33,880e20546d838090
X-Google-Attributes: gid10ba33,public
X-Google-Thread: 109fba,880e20546d838090
X-Google-Attributes: gid109fba,public
From: Brian Reynolds <brian.reynolds@iai.com>
Subject: Re: CC compiled .so does not work with g++ compiled main program
Date: 1998/12/23
Message-ID: <36814BCA.4A78@iai.com>
X-Deja-AN: 425269924
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Organization: Internet Maine/HarvardNet
Mime-Version: 1.0
Reply-To: brian.reynolds@iai.com
Newsgroups: comp.unix.programmer,gnu.g++.help,comp.lang.c++