On Fri, 6 Jun 2003 15:58:09 +0800 Verdi March <cincaipatron@gmx.net> wrote:
Hi,
Is there any special steps to link a *.cpp to a library created and compiled with C compiler?
I have a class that calls a C function in an existing library (libXX.so). This library is written in C. I got the following error while compiling, and I think it happens during linking: Make sure that the prototype for the function you are calling is declared as a C function (as an example): #if defined __cplusplus extern "C" { int foo(int a, int b); } #endif /* __cplusplus */ Most of the standard C functions are already taken care of when including things like <cstdio>.
-- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9