dynamic shared library that includes both C++ and C sources

Alexandre Oliva oliva@lsd.ic.unicamp.br
Sun Oct 31 23:03:00 GMT 1999


On Oct  4, 1999, Keith Bostic <bostic@abyssinian.sleepycat.com> wrote:

> What I don't understand is why gcc cannot compile standard C
> programs when linking with a library that includes both C++ and
> C modules.  Why should programmers have to know that a library
> contains both C++ and C modules when selecting a compiler for
> their application?

Ah, I missed the main issue of your post.  The problem is that just a
few systems support encoding dependencies of a shared library into the
library itself.  On several systems, you'll have to explicitly link
dependency libraries in whenever you link with the dependent shared
library.

GNU libtool could hide this complexity from you, automatically taking
care of supplying explicit dependencies on platforms that don't
support them implicitly, but unfortunately it doesn't fully support
C++ yet :-(

Please note that this has nothing to do with gcc; the issue has to do
with linkers and shared library formats.

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them



More information about the Gcc-bugs mailing list