newbie-question: extending python with c++

Brian Quinlan brian at sweetapp.com
Mon Apr 15 13:09:56 EDT 2002


Merman wrote: 
> I have a c++ -class; I can compile this class successful as
standalone-app.
> No problem.
> Now I want to work with swig.
> 
> There are three files: Tree.cpp, Tree.h, Tree.i
> 
> first step:
> swig -python -c++ -o Tree_wrap.cpp Tree.i (output is Tree_wrap.cpp -
it's
> ok)
> 
> second step:
> g++ -c Tree.cpp Tree_wrap.cpp -IC:\python22\include (also ok - output
are
> Tree.o and Tree_wrap.o)
> 
> third step - *build*:
> g++ Tree.o Tree_wrap.o -shared -o Tree.dll (this line throws lots of
> failures - whats wrong?)

Where need to link with Pythonxx.lib. But instead of this manual crap,
you should just write a simple distutils setup script.

Cheers,
Brian






More information about the Python-list mailing list