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:

> abyssinian:build_local {312} cc -g -I. -Wall -W t.c .libs/libdb-3.0.so
> t.c: In function `main':
> .libs/libdb-3.0.so: undefined reference to `terminate(void)'

> 4. Note, you can build the source file correctly if you use C++:

> abyssinian:build_local {315} g++ -g -I. -Wall -W t.c .libs/libdb-3.0.so

>    works.

g++ implicitly links with -lstdc++, where terminate is defined; cc
doesn't.

> Is it a bad idea to include both C++ and C modules in the same
> library?

Nope.

-- 
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