douningqiu4991 2013-11-10 03:51 采纳率: 0%
浏览 417
已采纳

是否可以将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?

  • 写回答

1条回答 默认 最新

  • doumei1203 2013-11-10 08:47
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?