trying to create python wrapper for cdk using swig

Lyle Johnson ljohnson at resgen.com
Mon Jan 8 10:50:46 EST 2001


> Then we compile thus:
> gcc -fPIC -g -O2 -I/usr/include/python1.5 -I/usr/local/include -
> DHAVE_CONFIG_H -c ./label_wrap.c
> gcc -shared label_wrap.o -o labelcmodule.so
> These also do not produce any errors.
>
> Then we test our wrapper by importing label into python. This produces
> the following error:
> ImportError: ./labelcmodule.so: undefined symbol: CDKDEBUG

Dubal,

I'm not familiar with CDK itself, I think you probably need to modify the
link line shown above so that it links the CDK library into your Python
extension module, e.g.

        gcc -shared label_wrap.o -o labelcmodule.so -L/usr/local/lib -lCDK

The last argument (-lCDK) may need to be modified depending on the library's
name; here I'm assuming it's "libCDK.a" or "libCDK.so". If CDK itself
depends on *other* libraries you may also have to add those to the end of
the link line -- but start out with what I've shown here.

Hope this helps,

Lyle






More information about the Python-list mailing list