Is it possible to call a static object (.so) file from Go? I've been searchign Google and I keep hitting upon the claim that I can do
lib, _ := syscall.LoadLibrary("...")
But trying this gives an error
undefined: syscall.LoadLibrary
and searching through Godocs I cannot find reference to this function in the syscall package. Is it possible to load a library and call its functions?
On a POSIX platform, you could use
cgo
to call dlopen and friends:As @JimB said, you should just use CGO, and put the linking to the dynamic/static library there. as per this example:
Read more here: http://blog.golang.org/c-go-cgo