2018-03-02 04:16
浏览 1.0k

无效标志#cgo LDFLAGS使用go lang中断了构建

I'm new to the go-lang. I want to use go command to build a binary named cryptogen (hyperledger/fabric tool). I download the source code from github and type the following command accroding to readme:

CGO_CFLAGS=" " GOBIN=/hyperledger/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/tools/cryptogen/metadata.Version=1.0.7" github.com/hyperledger/fabric/common/tools/cryptogen

On my Mac OS (OS version is 10.13, go-lang version is 1.10) I'm getting the following error:

go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -I/usr/local/share/libtool

I thought I missing libtool, after installed it, I'm still getting the same error.

What can I do next?

图片转代码服务由CSDN问答提供 功能建议

我是go-lang的新手。 我想使用go命令构建一个名为 cryptogen 的二进制文件(hyperledger / fabric工具)。 我从github下载了源代码,并键入了以下自述文件:

  CGO_CFLAGS =“” GOBIN = / hyperledger / src / github.com / hyperledger / fabric / build  / bin安装-tags“” -ldflags“ -X github.com/hyperledger/fabric/common/tools/cryptogen/metadata.Version=1.0.7” github.com/hyperledger/fabric/common/tools/cryptogen

在我的Mac OS(操作系统版本为10.13,go-lang版本为1.10)上,出现以下错误:

 开始构建github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11:#cgo LDFLAGS中的无效标志:-I / usr / local / share / libtool 

我以为我缺少 libtool ,安装后仍然出现相同的错误。

下一步我该怎么办 ?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • douyi1944 2018-03-03 12:36

    Just as an FYI, PKCS11 is not really required to use cryptogen. You can actually use -tags "nopkcs11"

    解决 无用
    打赏 举报

相关推荐 更多相似问题