我写了一个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
安装?