swig

module
v0.0.0-...-28b29c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2020 License: Apache-2.0

README

SWIG快速入门

简介

SWIG是一个软件开发工具,它将用C和c++编写的程序与各种高级编程语言连接起来(为其他需要生成库)。准确地说,SWIG生成了两个文件,一个文件是*_wrapper.cpp文件,一个是*.go文件。*_wrapper.cpp文件将C++接口封装为C接口。go文件通过上一节说的import "C"来引用C接口,并把对这些C接口的调用,封装为不涉及任何C特性的Go函数或方法。

SWIG安装
  • Mac/Ubuntu
sudo apt-get install bison 

unzip swig-rel-3.0.12.zip
cd   swig-rel-3.0.12
./autogen.sh  && ./configure
make -j 4 && sudo make install
  • Windows 10
# swig windows版本
https://sourceforge.net/projects/swig/files/swigwin
# 解压然后添加环境变量即可
windows不支持cgo,所以此路不通
参考资料

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL