Using C with C++ shared libraries

Subject: Using C with C++ shared libraries
From: William K. Gibson (
Date: Mon Jul 10 2000 - 12:25:50 MDT

This may be off topic for the group but...

Does anyone know if it is possible to link C++ compiled libraries in a C
program? I have compiled a C++ shared library and it works fine with any C++
program I compile- but when I try to link it from a C program, gcc complains
that the functions are all undefined.

I know that to get C functions to work in a C++ program you must define them
in the header file with the call:

extern "C" { }

Is there a similar trick that must be used to do the opposite? Or is it
simply impossible?

--William K. Gibson
1stDesk Systems

This archive was generated by hypermail 2a24 : Mon Jul 10 2000 - 12:28:42 MDT