11

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

2
  • I know gccgo is sometimes more compatible this way, but I don't think even it can compile to a DLL yet... Commented Sep 29, 2014 at 20:37
  • Some work in that direction has been undertaken, see issue 11058. August 2016: not done yet. Commented Aug 23, 2016 at 14:10

1 Answer 1

9

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.