在构建链码时出现了”ltdl.h未找到”的错误。

huangapple go评论130阅读模式
英文:

ltdl.h Not found error while building chaincode

问题

我正在尝试使用go build来构建一个链码。当我运行Go build命令时,它报告了以下错误:

.\hyperledger\fabric\vendor\github.com\miekg\pkcs11\pkcs11.g‌​o:29:18: 
fatal error:ltdl.h: No such file or directory
compilation terminated

我从这个链接安装了libtools。但是我仍然遇到相同的错误。

英文:

I am trying to build a chaincode by using go build. when i run Go build command its reporting

.\hyperledger\fabric\vendor\github.com\miekg\pkcs11\pkcs11.g‌​o:29:18: 
fatal error:ltdl.h: No such file or directory
compilation terminated

I installed libtools from this link. But I am getting the same error

答案1

得分: 16

这是我为您翻译的内容:

在Ubuntu上,这对我有效:
sudo apt install libltdl-dev

英文:

It worked for me on ubuntu:
sudo apt install libltdl-dev

答案2

得分: 9

如果您正在使用CentOS/RHEL 7,您可以使用以下代码:

yum install libtool-ltdl-devel
英文:

if you are using centos/RHEL 7
you can use this code

yum install libtool-ltdl-devel

答案3

得分: 6

对于Mac电脑,请确保已安装brew。以下命令适用于我:

brew install libtool
英文:

For Mac, make sure you have brew installed. This command worked for me:

brew install libtool

答案4

得分: 5

在Debian/Ubuntu环境下,尝试使用以下命令:

sudo apt install libtool libltdl-dev

英文:

On Debian/Ubuntu environment, try using the following command:

sudo apt install libtool libltdl-dev

答案5

得分: 2

请确保在您的go build或go test命令中添加**--tags nopkcs11**。错误应该会停止出现。

示例:go build --tags nopkcs11

如果您正在开发和测试代码,这将编译您的链码。

英文:

make sure to add --tags nopkcs11 to ur go build or go test command. The error should stop appearing

Example : go build --tags nopkcs11

This will compile your chaincode if you are in development and testing your code.

huangapple
  • 本文由 发表于 2017年4月26日 14:11:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/43626320.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定