英文:
Building the Go SWIG example code
问题
我正在尝试构建Go附带的示例SWIG绑定。我正在查看的文件位于misc/swig/callback目录下。
是否有关于如何构建此示例的说明?我尝试按照这里的说明进行操作:
http://www.swig.org/Doc2.0/Go.html
但是由SWIG生成的代码似乎无法使用g++编译(因为它使用了C++库
有人成功构建过这个示例吗?
谢谢!
英文:
I'm trying to build the example SWIG bindings that come with Go. The files I'm looking at are located in misc/swig/callback.
Are there instructions on how to build this example? I tried following the directions here:
http://www.swig.org/Doc2.0/Go.html
but the code generated by SWIG doesn't seem to compile with g++ (since it uses a C++ library <string>) and doesn't compile with g++ (with multiple compilation errors).
Has anyone built this example successfully?
Thanks!
答案1
得分: 1
例如,
$ export GOPATH=$HOME/gopath
$ cd $GOPATH/src/swig/callback
$ go clean
$ go install -v
swig/callback
$
由于你说你在使用g++时遇到了问题,你是否已经安装了所有与g++相关的内容?例如,
$ sudo apt-get install g++ g++-multilib libstdc++6
$ g++ --version
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
英文:
For example,
$ export GOPATH=$HOME/gopath
$ cd $GOPATH/src/swig/callback
$ go clean
$ go install -v
swig/callback
$
Since you say you had problems with g++, do you have everything installed for g++? For example,
$ sudo apt-get install g++ g++-multilib libstdc++6
$ g++ --version
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论