Pole_Zhang
Pole_Zhang

Reputation: 1467

Can Go code generate dll in windows or can C ++/C# call golang code?

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

Upvotes: 11

Views: 11169

Answers (1)

thwd
thwd

Reputation: 24878

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.

Upvotes: 9

Related Questions