Search This Blog

Jan 24, 2008

SWIG call C function

Download the Swig, check the Examples\python\simple. It makes a dll project. Something need notice.
1. VC7 tools->option->projects->VC++ Directories->Excutable files "c:\swigwin"
tools->option->projects->VC++ Directories->Include files "c:\python25\include"
tools->option->projects->VC++ Directories->Library files "c:\python25\libs"
tools->option->projects->VC++ Directories->Library files "c:\python25\lib"

2. example.i customer build step->command line
swig -python "$(InputPath)"

3. project properties C/C++->Advanced->Compile As->Compile as C++ code(/TP)

after that, write simple python file and can call windows functions.

No comments: