在Github上下了一个项目,在使用LiteIDE编译时报错,错误信息如下:
# github.com/miekg/pkcs11 D:\goproject\src\github.com\miekg\pkcs11\pkcs11.go:29:10: fatal error: ltdl.h: No such file or directory
#include <ltdl.h>
^~~~~~~~ compilation terminated.
错误: 进程退出代码 2.
命令行解决方法:go build -tags nopkcs11
LiteIDE解决办法:编译环境-》自定义-》BUILDARGS:-i -tags nopkcs11
-
如果在ubunt操作系统中,只需安装:
apt install libltdl3-dev
-
如果在centos操作系统中,只需安装:
yum install libtool-ltdl-devel
问题解决。
附加内容:安装govendor项目依赖管理工具:
go get -u github.com/kardianos/govendor 编译 一个 govendor
找到govendor.exe文件的路径,添加到环境变量中。