fabric hello world by mac

0、参考https://www.ibm.com/developerworks/cn/cloud/library/cl-ibm-blockchain-chaincode-development-using-golang/index.html1、先写一个hello.go文件位于cd $GOPATH/src即 /Users/frank/go/src/hello.gofabric资源在$GOPATH/src/github.com/hyperledger

import "fmt"
import "github.com/hyperledger/fabric/core/chaincode/shim"


func main() {


	fmt.Println("hello world . 你好 世界!")


}
这里遇到import shime文件报错go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -I/usr/local/share/libtool

解决办法:https://stackoverflow.com/questions/49062730/invalid-flag-cgo-ldflags-break-build-with-go-lang

remove '/usr/local/share/libtool' from github.com/miekg/pkcs11 HEAD and then build successfully.
找到pkcs11.go文件,打开后搜索'/usr/local/share/libtool',发现有两行注释中包含,删除后可以编辑通过!  

猜你喜欢

转载自blog.csdn.net/frankxixu/article/details/80791822