可以去代码在Windows生成DLL或可以C ++ / C#调用golang代码? [英] Can Go code generate dll in windows or can C ++/C# call golang code?

查看:597
本文介绍了可以去代码在Windows生成DLL或可以C ++ / C#调用golang代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用 C ++ C#代码在Windows上调用Go函数吗? Go是否支持在Windows中生成dll?

Can Go functions be called by C++ or C# code on windows? Does Go support generating dll in Windows?

推荐答案

不,Go代码是静态链接的。其原因是Go的运行时间,它嵌入到每个可执行文件中,等等。

No, Go code is statically linked. The reason for this is Go's runtime, which is embeded in every executable, among other things.

编辑:

显然可能存在很多间接性,但在实践中还远未实用。
请参阅从C调用函数和链接的博客文章以获取更多信息。

It is apparently possible with a lot of indirection, but far from usable in practice. See Call go functions from C and the linked blog posts for more information.

这篇关于可以去代码在Windows生成DLL或可以C ++ / C#调用golang代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆