[Pythonmac-SIG] embedding link errors

Jack Jansen jack@oratrix.nl
Tue, 13 Feb 2001 15:22:06 +0100


 
> I'm trying to embed Python in my C/C++ application,
> using CodeWarrior 6.0.
> 
> When I compile just C files, it all works fine. When
> I use a C++ file or just activate the C++ compiler,
> I get the following link error:
> 
> 	Link Error : undefined 'PyMac_Initialize()' (code)

Have you included macglue.h? As Python is in C you need extern "C" { }
brackets around the declaration if you want to use it from C++. macglue.h has 
those brackets. At least: I assume you're using MacPython 2.0, it could be 
that they were still missing from 1.5.2.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm