无法在窗口上编译结构 - 缺少 ltdl.h

Can't compile fabric on windows - missing ltdl.h

本文关键字:缺少 ltdl 结构 编译 窗口      更新时间:2023-10-16

我正在尝试使用go build构建链码。

环境:

  • 已安装 Go 1.8.3 Windows/AMD
  • 视窗 10

当我运行go build时,出现以下错误:

# github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
....github.comhyperledgerfabricvendorgithub.commiekgpkcs11pkcs11.go:29:18: fatal error: ltdl.h: No such file or directory
compilation terminated.

我检查了一下,我的 GCC 安装不包含包含文件夹中的ltdl.h文件。

我找到了一个SO帖子,其中包含Linux的解决方案,但没有Windows解决方案。

有人可以帮忙吗?

在Windows上,您可以在没有PKCS的情况下构建

go build --tags nopkcs11

尝试运行以下命令

sudo apt install libtool libltdl-dev

确保go get -u github.com/hyperledger/fabric/core/chaincode/shim没有抛出错误,然后go build它。