我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

是否可以将go软件包打包为.so或.a文件?

Recently I have spent some time on cgo and how to write C codes in go. It seems very easy to load a .so file by using #cgo directives. However, are there any ways that we can do this in a opposite way? That is, can we build a go package to a .so or .a file so that it can be used by c/c++ projects directly?

The answer is Go code can't be dynamically loaded into C code yet.

There is some activity on making this possible, but it isn't ready now.

See the discussion at on the mailing list.

近期文章

  • 如何在Go中为App Engine任务队列创建任务?
  • 类型声明后的golang类型转换
  • 什么会造成goroutines的巨大开销?
  • 获取当前模板名称?
  • 如何在Go中使用Blackfriday将markdown呈现为html?
  • 联系表单邮件处理程序示例以继续进行Appengine
  • 接口作为参数。 这怎么可能?
  • 将多维JSON文件映射到Go结构
  • 将字符串作为参数提供给%09d时,带有sprintf的golang错误
  • 如何使用sqlite3.h和cgo打开新的sqlite3数据库?
  • 附加到一部分结果
  • 模板中断http HEAD方法
  • 如何在Go中创建自定义类型元素的自定义类型数组?
  • GAE GO-HTML模板和数据安全
  • 在Go中获取指向列表中的结构的指针
  • Go-如何为动态软件包组织代码
  • 最佳做法,如何初始化自定义类型?
  • 对Kate的Golang文本突出显示支持
  • 在win7-64中调用dll时,golang syscall出现问题
  • 如何通过Android上运行的Go程序访问互联网?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华