在其他计算机上加载共享库(libcrypto)时发生Golang cgo错误

在其他计算机上加载共享库(libcrypto)时发生Golang cgo错误,go,compilation,openssl,cgo,libcrypto,Go,Compilation,Openssl,Cgo,Libcrypto,我编写了一个go包,它只是一个C程序的包装器,需要openssl才能工作 我的CGO设置如下: // #cgo CFLAGS: -Imy/library/include -Imy/library/src -I/usr/local/opt/openssl/include // #cgo LDFLAGS: -L/usr/include/openssl -Lmy/library/src -lcrypto // #include <my_library.c> // #include <

我编写了一个go包,它只是一个C程序的包装器,需要
openssl
才能工作

我的CGO设置如下:

// #cgo CFLAGS: -Imy/library/include -Imy/library/src -I/usr/local/opt/openssl/include
// #cgo LDFLAGS: -L/usr/include/openssl -Lmy/library/src -lcrypto
// #include <my_library.c>
// #include <stdlib.h>
import "C"

如何使其在未安装
libssl dev
的PC上也能工作?

静态链接您的程序,或安装缺少的库。静态链接我的程序是什么意思?因此,在无法工作的计算机上,尝试搜索
libcrypto*
,看看会找到什么(如果有的话)。有可能会找到这个库,但它会有一个不同的所谓“soname”——其中包含一个不同的版本(不是1.1)。
error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory