Embedding Python in MaxMSP

Charlie DeTar chazen at gmail.com
Tue Nov 23 20:34:09 EST 2004


A pretty ugly one - embedding python in an external for a proprietary
semi-legacy macintosh application, MaxMSP:

I am trying to update Bill Orcutt's "nyptho" python interpreter
external for MaxMSP (http://www.publicbeta.cx/max/) to actually work
with the latest versions of OS X and python.  Currently, the C calls
made by nyptho are to the older PyMac methods, and thus they depend on
the older MacPython distribution.

After some simple changes of the "nyptho" code to use the current
standard Python libraries instead, compilation seems to work fine, but
I am getting the following errors from the linker:

/usr/bin/gcc-3.3  -o "/Users/tc1/Sources/MaxMSP-SDK/Mach-O
Development/nyptho/build/nyptho.mxo/Contents/MacOS/nyptho"  
"-L/Users/tc1/Sources/MaxMSP-SDK/Mach-O Development/nyptho/build"
"-L/sw/lib/python2.3/config/" "-F/Users/tc1/Sources/MaxMSP-SDK/Mach-O
Development/nyptho/build" "-F/Library/Frameworks"  -filelist
"/Users/tc1/Sources/MaxMSP-SDK/Mach-O
Development/nyptho/build/nyptho.build/nyptho.build/Objects-normal/LinkFileList"
 "-framework" "Carbon" "-framework" "MaxAPI"  "-arch" "ppc" "-bundle"
"-ldl"
ld: Undefined symbols:
_PyEval_InitThreads
_PyRun_SimpleFile
_PyRun_SimpleString
_PySys_SetArgv
_Py_Finalize
_Py_Initialize 

I am curious about the preceding underscores on the undefined symbols
- they are nowhere in the source code.  I am very new to C, and am
using Mac's "XCode" IDE (as that's what the MaxMSP SDK examples are
in, and I haven't strayed far from them yet).  Following Python's
linker instructions (http://python.org/doc/2.3.4/ext/link-reqs.html)
does nothing but add _PyMac_Error to the list of undefined symbols.

As I mentioned, I am very new to C, and especially don't know anything
about C++.  But I feel like I'm so close to having something at least
testable here!  Any ideas?

Thanks,
Charlie DeTar



More information about the Python-list mailing list