3 ms·
What's the state of dynamic linking in go? even with C libs , is it supported ? if yes does it work on Windows ? thx.
by aikah 11y ago
What's the state of dynamic linking in go? even with C libs , is it supported ? if yes does it work on Windows ? thx.
- Merovius 11y agoIt is supported. So you can both compile your go packages as a shared object file and link against it and you can compile it into a shared library and load it from C. I have no idea about windows support.
- irq-1 11y agoVery little of what was planned was implemented in 1.5. See the design doc: https://golang.org/s/execmodes https://golang.org/s/execmodes edited summary: - Go code linked into, and called from, a non-Go program In the Go 1.5 release this mode is implemented, using a .a file, for most Unix systems. - Go code as a shared library plugin with a C style API In the Go 1.5 release this mode is implemented for linux-amd64, linux-arm, darwin-amd64, and darwin-arm. When using gccgo it is implemented for any supported target. - Go code as a shared library plugin with a Go style API This is not implemented in the Go 1.5 release. - Go code that uses a shared library plugin This is not implemented in the Go 1.5 release. - Building Go packages as a shared library In the Go 1.5 release this is implemented for the linux-amd64 target only. When using gccgo it is implemented for any supported target. - A Go program built as a PIE This is not implemented in the Go 1.5 release.