从源代码构建代码的问题

时间:2017-10-07 23:26:00

标签: go

我正在从源代码构建以太坊(因为我需要将源代码提供给调试器,以跟踪其工作原理)并且我在构建期间出错:

[niko@localhost sources]$  go run  github.com/ethereum/go-ethereum/cmd/geth/main.go ---verbosity 5 --ipcdisable --port 40401 --rpc --rpcport 9101 --pprof --datadir=/home/niko/saved-niko-home/myeth/ --networkid=15 console 
# command-line-arguments
github.com/ethereum/go-ethereum/cmd/geth/main.go:115: undefined: configFileFlag
github.com/ethereum/go-ethereum/cmd/geth/main.go:146: undefined: initCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:147: undefined: importCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:148: undefined: exportCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:149: undefined: removedbCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:150: undefined: dumpCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:152: undefined: monitorCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:154: undefined: accountCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:155: undefined: walletCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:157: undefined: consoleCommand
github.com/ethereum/go-ethereum/cmd/geth/main.go:157: too many errors
[niko@localhost sources]$ 

所有未定义的符号都包含在这些文件中:

[niko@localhost sources]$ ls -l github.com/ethereum/go-ethereum/cmd/geth/config.go  github.com/ethereum/go-ethereum/cmd/geth/chaincmd.go github.com/ethereum/go-ethereum/cmd/geth/monitorcmd.go github.com/ethereum/go-ethereum/cmd/geth/accountcmd.go
-rw-rw-r--. 1 niko niko 11843 Sep 12 09:10 github.com/ethereum/go-ethereum/cmd/geth/accountcmd.go
-rw-rw-r--. 1 niko niko 10036 Sep 12 09:10 github.com/ethereum/go-ethereum/cmd/geth/chaincmd.go
-rw-rw-r--. 1 niko niko  5881 Sep 12 09:10 github.com/ethereum/go-ethereum/cmd/geth/config.go
-rw-rw-r--. 1 niko niko 11362 Sep 12 09:10 github.com/ethereum/go-ethereum/cmd/geth/monitorcmd.go
[niko@localhost sources]$ 

但是,如果我将这些文件添加到命令行,我将收到另一个错误(符号重复),我在另一个问题中提交了这个错误:can not use function as type in Go

所以,不知何故,使用自动构建过程,以太坊被编译为包含这些变量(configFileFlag,initCommand等),但是当我尝试手动执行时,我缺少一些东西。但是哪些东西?

0 个答案:

没有答案