开发者

How to compile SWIG via windows

I've downloaded swigwin, sigwin for windows, and have been checking examples. However, most examples have to compile like this: swig -example.i. I tried doing this over the cmd prompt but it does not work. Can you please teach me how I can do this 开发者_如何转开发on windows?


You have to choose a language. To create a Python extension wrapper for C:

swig -python example.i

for C++:

swig -python -c++ example.i

See swig -help.

You may also need to add swig to your path. Something like:

path c:\swigwin-2.0.0;%path%

Or add it through Control Panel, System, Advanced, Environment Variables (on WinXP).


Given the fact that you're asking about compilation, I'll like to add two things (knowing there already is an excepted answer):

  • I've come here from Google looking for how to compile on Windows, and the swig command does not compile anything. It just translates given input to (in my case) .java and a *_wrap.c files, which is uncompiled source code
  • in order to compile - in terms of using the gcc or g++ commands from SWIG's tutorial - you have to install a compiler. The Windows examples describes three options: Visual Studio, Cygwin or MinGW (download here). To compile the .java files from above just use javac; for details see the according "Building a module"-section in the tutorials.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜