您的位置:首页 > 新闻 > 热点要闻 > SWIG源码安装

SWIG源码安装

2024/10/18 1:12:57 来源:https://blog.csdn.net/youlinhuanyan/article/details/139485608  浏览:    关键词:SWIG源码安装

SWIG源码安装

https://github.com/swig

下载源码首先需要先生成.configure,在执行make & make install

./autogen.sh 
+ test -d Tools/config
+ aclocal -I Tools/config
./autogen.sh: 11: aclocal: not found

报错了

解决方案,安装automake

sudo apt-get install automake libtool -y

再次执行

./autogen.sh 
+ test -d Tools/config
+ aclocal -I Tools/config
+ autoheader
+ automake --add-missing --copy --force-missing
configure.ac:23: installing 'Tools/config/compile'
configure.ac:11: installing 'Tools/config/config.guess'
configure.ac:11: installing 'Tools/config/config.sub'
configure.ac:12: installing 'Tools/config/install-sh'
configure.ac:12: installing 'Tools/config/missing'
Source/Makefile.am: installing 'Tools/config/depcomp'
+ autoconf
+ cd CCache
+ autoreconf

开始编译

make
# 报错
make[1]: Entering directory '/home/bing/occ/swig/Source'
/bin/bash '/home/bing/occ/swig/Tools/config/missing' bison -d -Wall -Werror  --output=CParse/parser.c ./CParse/parser.y
/home/bing/occ/swig/Tools/config/missing: line 81: bison: command not found
WARNING: 'bison' is missing on your system.You should only need it if you modified a '.y' file.You may want to install the GNU Bison package:<https://www.gnu.org/software/bison/>
make[1]: *** [Makefile:1346: CParse/parser.c] Error 127
make[1]: Leaving directory '/home/bing/occ/swig/Source'
make: *** [Makefile:36: source] Error 2
(base) bing@bing-ThinkPad-T14p-Gen-1:~/occ/

解决办法,继续安装提示缺少的库

$ sudo apt-get install bison

安装完,再次执行make执行成功

$ make
$ sudo make install
...
Installing /usr/local/share/swig/4.3.0/std/std_wsstream.i
Installing /usr/local/share/swig/4.3.0/std/std_wstreambuf.i
Installing /usr/local/share/swig/4.3.0/std/std_wstring.i
make[1]: Entering directory '/home/bing/occ/swig/CCache'
Installing ccache-swig
Installing /usr/local/bin/ccache-swig
/usr/bin/install -c -d /usr/local/bin
/usr/bin/install -c -m 755 ccache-swig /usr/local/bin/ccache-swig
make[1]: Leaving directory '/home/bing/occ/swig/CCache'
Installation complete

安装成功
我们查看一下swig的版本

$ swig  -versionSWIG Version 4.3.0Compiled with g++ [x86_64-pc-linux-gnu]Configured options: +pcrePlease see https://www.swig.org for reporting bugs and further information

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com