windows 如何安装 SWIG?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7443112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install SWIG?
提问by Paul Manta
Noob question ahead...
菜鸟问题前面...
I'm trying to install SWIG on Windows. According to the INSTALL document, I have to
我正在尝试在 Windows 上安装 SWIG。根据安装文件,我必须
cd
to the directory containing the package's source code and type./configure
to configure the package for your system.
cd
到包含包源代码的目录,然后键入./configure
为您的系统配置包。
I tried the command in both the root directory and in the /CCache
directory (these are the only ones that have the configure
and configure.in
files), however, the shell reports back that
我在根目录和目录中都尝试了该命令/CCache
(这些是唯一具有configure
和configure.in
文件的命令),但是,shell 报告说
C:\swigwin-2.0.4>./configure
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\swigwin-2.0.4>./configure
'.' is not recognized as an internal or external command,
operable program or batch file.
What am I missing?
我错过了什么?
采纳答案by Paul Manta
The page http://www.swig.org/download.htmlhas a specific download for Windows with a pre-built version of swig.exe. You can download it and avoid the hassle of compiling swig by yourself.
页面http://www.swig.org/download.html有一个针对 Windows 的特定下载,其中包含 swig.exe 的预构建版本。可以下载,免去自己编译swig的麻烦。
If you really need to, you can consult the file Doc/Manual/Windows.html that contain Windows-specific instructions to build SWIG.
如果确实需要,您可以查阅文件 Doc/Manual/Windows.html,其中包含构建 SWIG 的特定于 Windows 的说明。
Finally, to answer your specific question, the syntax
最后,要回答您的具体问题,语法
./configure
is a UNIX-style command that means 'execute the program named configure in the current directory' (the dot)
是一个 UNIX 风格的命令,意思是“执行当前目录中名为 configure 的程序”(点)
On Windows, you would type
在 Windows 上,您将键入
.\configure
or even simpler, as all files are executable on Windows, only
甚至更简单,因为所有文件都可以在 Windows 上执行,只有
configure
... BUT this will not work as the said 'configure' script is a bash script that will not run in a Windows shell.
...但这将不起作用,因为所述“配置”脚本是一个无法在 Windows shell 中运行的 bash 脚本。
回答by user1438644
no installation is needed. you just have to set the environment variable to point to the "swig" 's executable which is under the root directory of swig
无需安装。您只需将环境变量设置为指向 swig 根目录下的“swig”可执行文件
On the SWIG site, you can download for example the swigwin-2.0.7 zip directory for windows's swig. unzip it in a directory of your choice for example on "C:\Program Files"
directory if you want. After this, you have the swig executable in the "C:\Program Files\swigwin-2.0.7"
directory: "C\Program Files\swigwin-2.0.7\swig"
you have to set now the environment variable "path" to point to this swig exec: add for this the "C:\Program Files\swigwin-2.0.7" path to the "path"variable according to my example; that is all you need to use swig on windows. You can now play with swig so, open a prompt "cmd" and just type "swig --help" on this prompt you can see a list of the differents options you can use with swig.
If you d'ont have visual c++, you can use for example codeblock, that is my case so the link below could be a help for you : http://wiki.codeblocks.org/index.phptitle=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
例如,在 SWIG 站点上,您可以下载 windows swig 的 swigwin-2.0.7 zip 目录。"C:\Program Files"
如果需要,将其解压缩到您选择的目录中,例如在目录中。在此之后,您在"C:\Program Files\swigwin-2.0.7"
目录中有 swig 可执行文件:"C\Program Files\swigwin-2.0.7\swig"
您现在必须设置环境变量“path”以指向此 swig exec:为此添加“C:\Program Files\swigwin-2.0.7”路径到根据我的例子,“路径”变量;这就是在 Windows 上使用 swig 所需的全部内容。您现在可以玩 swig,因此,打开提示“cmd”并在此提示上键入“swig --help”,您可以看到可以与 swig 一起使用的不同选项的列表。如果你没有visual c++,你可以使用例如代码块,这就是我的情况,所以下面的链接可能对你有帮助:http://wiki.codeblocks.org/index.phptitle=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system
回答by Francesco Mantovani
Download Miniconda.
下载Miniconda。
Then follow this guideand do: conda install -c anaconda swig
然后按照本指南进行操作:conda install -c anaconda swig