I’m trying to import .so library in Go project like this:
// #cgo LDFLAGS: -L. -libcapi20.so import "C"
I get this error:
/usr/bin/ld: cannot find -libcapi20.so collect2: error: ld returned 1 exit status
I tried to put libcapi20.so in different folders. Even in usr/bin. Tried to write path to .so-file in “-L.” flag. Tried without “.so” suffix. Same error everytime.
My OS: Ubuntu 17.10. Go SDK: 1.10, actually in 1.9 - same error.
If I am importing library correct then I suppose it can be incorrect version of Ubuntu or broken .so-file.