介绍
官方简介
SWIG is a compiler that integrates C and C++ with languages
including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua,
Octave, R, Scheme (Guile, MzScheme/Racket), Scilab, Ocaml.
SWIG can also export its parse tree into XML.
中文简介
SWIG (Simplified Wrapper and Interface Generator) ,即简化包以及接口生成器,为脚本语言(tcl,perl,python等)提供了C和C++的接口。
安装教程
git clone https://github.com/swig/swig.git
cd swig
sudo apt-get -y update
sudo apt-get install -y libpcre3 libpcre3-dev
./configure --prefix=/usr --without-clisp --without-maximum-compile-warnings
make
sudo make install
install -v -m755 -d /usr/share/doc/swig
sudo cp -v -R Doc/* /usr/share/doc/swig
sudo apt-get install -y libatlas-base-dev
sudo echo "PATH=/usr/bin/swig:$PATH" >> /etc/profile
source /etc/profile
测试
swig -version
SWIG Version 4.0.0
Compiled with g++ [armv7l-unknown-linux-gnueabihf]
Configured options: +pcre
Please see http://www.swig.org for reporting bugs and further information