3

I am trying to build a chaincode using go build.

Environment:

  • installed go 1.8.3 windows/amd
  • Windows 10

When I run go build I get the following error:

# 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.

I checked and my GCC installation does not contain the ltdl.h file in the include folder.

I found a SO post with a solution for Linux, but not one for Windows.

Can someone help?

Igor L.
  • 3,159
  • 7
  • 40
  • 61

2 Answers2

4

On windows you can build without PKCS

go build --tags nopkcs11

deimus
  • 9,565
  • 12
  • 63
  • 107
  • Damn, I was hoping someone figured out how to get pkcs11 working on Windows. Will probably have to cross compile or use cygwin. – Keehl Apr 22 '20 at 10:15
0

Try running the following command

sudo apt install libtool libltdl-dev

Make sure go get -u github.com/hyperledger/fabric/core/chaincode/shim throws no error then go build it.