我正在尝试使用go build
构建链代码。
环境:
当我运行go build
时,我收到以下错误:
# github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
..\..\github.com\hyperledger\fabric\vendor\github.com\miekg\pkcs11\pkcs11.go:29:18: fatal error: ltdl.h: No such file or directory
compilation terminated.
我检查过,我的GCC安装中不包含 include 文件夹中的 ltdl.h 文件。
我发现了一个带有solution for Linux的SO帖子,但没有一个用于Windows。
有人可以帮忙吗?
答案 0 :(得分:4)
在Windows上,您可以在不使用PKCS
go build --tags nopkcs11
答案 1 :(得分:0)
尝试运行以下命令
sudo apt install libtool libltdl-dev
确保go get -u github.com/hyperledger/fabric/core/chaincode/shim
不会引发任何错误,然后go build
。