Mixing libraries in C and C++

Vu Pham vu@sivell.com
Fri Jun 22 11:41:00 GMT 2001


You need to declare extern C in C++ files for functions that are called from
C.

----- Original Message -----
From: "Alberto Faraldos Izquierdo" <alberto.faraldos@sema.es>
To: <gcc-help@gcc.gnu.org>; <gcc@gcc.gnu.org>
Sent: Friday, June 22, 2001 3:58 AM
Subject: Mixing libraries in C and C++


> Hello.
>
> I need to mix into a program written in C, a library written in C++ with
> some libraries written in C. The code C++ is compiled with G++, and
> libraries written in C are compiled with GCC. When I try to compile and
> link all these libraries and the main program written in C with GCC, it
> produces several "Undefined symbol" errors when it tries to link all. Is
> there any option or workaround to avoid this problem?.
>
> Thanks in advance.
> Alberto
> Madrid (Spain)
>
> ------------------------------------------------------------------
> This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
SchlumbergerSema.
> If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding, printing,
or copying of this email is strictly prohibited.
> ------------------------------------------------------------------
>




More information about the Gcc-help mailing list