HiveBrain v1.2.0
Get Started
← Back to all entries
patterngoCritical

exec: "gcc": executable file not found in %PATH% when trying go build

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
gccfoundbuildfileexecutablenotpathwhenexectrying

Problem

I am using Windows 10. When I tried to build Chaincode it reported this error

# github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11 
exec: "gcc": executable file not found in %PATH%


My chaincode imports:

import (
    "fmt"
    "strconv"

    "github.com/hyperledger/fabric/core/chaincode/shim"
    pb "github.com/hyperledger/fabric/protos/peer"
)


It's running fine in Docker.

Solution

gcc (the GNU Compiler Collection) provides a C compiler. On Windows, install TDM-GCC. The github.com/miekg/pkcs11 package uses cgo. Cgo enables the creation of Go packages that call C code.

Context

Stack Overflow Q#43580131, score: 153

Revisions (0)

No revisions yet.