GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - feixiao/swig: swig快速入门

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
basic
basic
 
 
cgo
cgo
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
ReadMe.md
ReadMe.md
 
 

Repository files navigation

SWIG快速入门

简介

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

  • 项目地址
  • 项目自带Examples
  • 文档

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,所以此路不通

参考资料

  • 《go通过swig封装、调用c++共享库的技术总结》
  • 《使用swig工具为go语言与c++进行交互》

About

swig快速入门

Topics

cgogoswig

Resources

Readme
Apache-2.0 license
Activity

Stars

19 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.