英文:
Can Go code generate dll in windows or can C ++/C# call golang code?
问题
Go functions can be called by C++
or C#
code on Windows. Go supports generating DLLs in Windows.
英文:
Can Go functions be called by C++
or C#
code on windows? Does Go support generating dll in Windows?
答案1
得分: 9
不,Go代码是静态链接的。这是因为Go的运行时嵌入在每个可执行文件中,还有其他原因。
编辑:
显然可以通过很多间接方式实现,但在实践中远非可用。
有关更多信息,请参阅从C调用Go函数和链接的博客文章。
英文:
No, Go code is statically linked. The reason for this is Go's runtime, which is embeded in every executable, among other things.
Edit:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论