This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: dynamic shared library that includes both C++ and C sources
- To: oliva at lsd dot ic dot unicamp dot br
- Subject: Re: dynamic shared library that includes both C++ and C sources
- From: Keith Bostic <bostic at abyssinian dot sleepycat dot com>
- Date: Mon, 4 Oct 1999 12:33:05 -0400 (EDT)
- Cc: gcc-bugs at gcc dot gnu dot org
> From: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
>
> 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.
I don't understand why this is relevant, would you please
expand on your answer?
I realize that g++ can compile programs when linked with a
library that contains both C++ and C modules.
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?
Regards,
--keith
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic bostic@bostic.com
394 E. Riding Dr. +1-978-287-4781
Carlisle, MA 01741 http://www.bostic.com