Swigのインストール

環境設定swig

SwigはC/C++で書かれたプログラムを他言語で使えるようにするツールです。WindowsでのSwigのインストール方法を記載します。

Chocolateyのインストール

Windows用のパッケージマネージャーであるChocolateyをインストールします。

インストールサイト:https://chocolatey.org/install

Choose Your Installation MethodからIndividualを選択すると、コマンドが選択できるようになります。

管理者権限でPowerShellを開いて以下を実行します。

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

インスールが完了するとchocoが使えるようになります。

PS C:\Windows\system32> choco
Chocolatey v2.1.0
Please run 'choco -?' or 'choco <command> -?' for help menu.

Swigのインストール

choco install swig
> PS C:\Users\admin> swig -version

SWIG Version 4.1.1

Compiled with i686-w64-mingw32-g++ [i686-w64-mingw32]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

簡単にインストールできました。なお、Pythonで使う場合だと

conda install -c anaconda swig

だけでもインストールできます。

環境設定swig

Posted by fortunefox5