🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
1 messages
1 total messages Started by Brian Reynolds Wed, 23 Dec 1998 00:00
Re: CC compiled .so does not work with g++ compiled main program
#3395
Author: Brian Reynolds
Date: Wed, 23 Dec 1998 00:00
47 lines
1906 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads