JFJun / go-substrate-crypto

create substrate address and offline sign
0 stars 3 forks source link

交叉编译问题请教 #3

Closed sugeladi closed 3 years ago

sugeladi commented 3 years ago

我有使用到 https://github.com/JFJun/bifrost-go 这个项目,在交叉编译的时候提示 undefined: secp256k1.CompressPubkey 编译命令 GOOS=linux GOARCH=amd64 go build

报错提示

github.com/JFJun/go-substrate-crypto/crypto/ecdsa

vendor/github.com/JFJun/go-substrate-crypto/crypto/ecdsa/ecdsa.go:33:12: undefined: secp256k1.CompressPubkey vendor/github.com/JFJun/go-substrate-crypto/crypto/ecdsa/ecdsa.go:44:12: undefined: secp256k1.CompressPubkey vendor/github.com/JFJun/go-substrate-crypto/crypto/ecdsa/ecdsa.go:50:9: undefined: secp256k1.Sign

请问有遇到这个问题吗?

JFJun commented 3 years ago

我有使用到 https://github.com/JFJun/bifrost-go 这个项目,在交叉编译的时候提示 undefined: secp256k1.CompressPubkey 编译命令 GOOS=linux GOARCH=amd64 go build

报错提示

github.com/JFJun/go-substrate-crypto/crypto/ecdsa

vendor/github.com/JFJun/go-substrate-crypto/crypto/ecdsa/ecdsa.go:33:12: undefined: secp256k1.CompressPubkey vendor/github.com/JFJun/go-substrate-crypto/crypto/ecdsa/ecdsa.go:44:12: undefined: secp256k1.CompressPubkey vendor/github.com/JFJun/go-substrate-crypto/crypto/ecdsa/ecdsa.go:50:9: undefined: secp256k1.Sign

请问有遇到这个问题吗? 这是因为引用了go-ethereum这个包的问题,我忘记了是哪个版本开始了,编译go-ethereum在windows上是不能交叉编译了,你到linux机器上编译就好了

sugeladi commented 3 years ago

我是在macos上交叉编译为linux,发现有这个报错,搜索了一下go-ethereum的 issue https://github.com/ethereum/go-ethereum/issues/16818 发现有人在用xgo,我在研究一下,实在不行,我就去linux机器上编译。 多谢