Compiling and linking

Requires some experience with C
Must locate the Python.h file
Must compile wrapper code and C code
Result: shared library
C++ modules: not trivial (SWIG was made for C)
PREFIX=`python -c 'import sys; print sys.prefix'`
VERSION=`python -c 'import sys; print sys.version[:3]'`

gcc -O -I.. -I$PREFIX/include/python$VERSION \
    -c ../draw.c draw_wrap.c
gcc -shared -o draw.so draw.o draw_wrap.o

previousnexttable of contents