Can Go functions be called by C++ or C# code on windows? Does Go support generating dll in Windows?
-
I know gccgo is sometimes more compatible this way, but I don't think even it can compile to a DLL yet...rogerdpack– rogerdpack2014-09-29 20:37:19 +00:00Commented Sep 29, 2014 at 20:37
-
Some work in that direction has been undertaken, see issue 11058. August 2016: not done yet.Deleplace– Deleplace2016-08-23 14:10:02 +00:00Commented Aug 23, 2016 at 14:10
Add a comment
|
1 Answer
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.