[C++-SIG] Beginer questions

Ian Searle ians at amc.com
Mon Nov 15 15:18:02 CET 1999

You can place all of the C++ function declarations, the ones that appear in the method tables in an extern "C" wrapper too.  But, that has the very ugly side effect of exposing your entire interface to the world.

David Beazley wrote:

> Paul F. Dubois writes:
> >
> > This reminds me to call attention of the C++ SIG to the article in the =
> > July/Aug 1999 C++ report that explains that pointers to C functions and =
> > pointers to C++ functions are no longer type compatible.  This has =
> > serious implications for extending Python with C++, in that Python's =
> > tables expect a C function. Up to now it has been possible to just cast =
> > whatever to PyCFunction and move on; evidently some compilers will now =
> > start to object to that if the function in question is a C++ one. I =
> > haven't had time to look at this to see if I have a decent work-around.
> >
> I ran into this problem with SWIG when I upgraded to a new C++
> compiler.  To get around it, I just placed all of the wrapper code
> inside an extern "C" block.  I'm not sure if this is an ideal
> solution and I have no idea what it means for CXX.   It seemed to work
> for SWIG however.
> Cheers,
> Dave

More information about the Cplusplus-sig mailing list