我写了一个 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"
我可以在我的 Mac 和我创建的 Docker 容器中编译和运行它,但是当我尝试在另一台机器上运行(它已经编译)时,我得到了错误:
error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
如何使其在未libssl-dev
安装的 PC 上也能正常工作?