According to the Go FAQ, you can call the C libraries using the "external functions interface":
Links to Go Go programs with C / C ++ programs?
There are two implementations of the Go compiler, 6g and friends, commonly called gc, and gccgo. Gc uses a different calling convention and linker, and therefore can only be associated with C programs using the same convention. There is such a C compiler, but not a C ++ compiler. Gccgo is a GCC interface that can be used with caution with GCC-compiled C or C ++ programs. However, since Go is garbage collection, it will not be wise to do this, at least naively.
There is an “external function interface” that allows the safe calling of C-written libraries from Go code. We expect to use SWIG to extend this feature to C ++ libraries. There is a safe way to call Go code with C or C ++.
To answer your earlier question about the Windows DLL: no, as there is currently no implementation of Windows Go. For more information read can-go-compiler-be-installed-on-windows
source share