duannei1477 2017-10-07 23:26
浏览 103

从源代码构建go代码时遇到问题

I am building Ethereum from sources (because I need to feed sources into debugger, to trace how it works) and I have an error during build:

[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]$ 

All the undefined symbols are contained in these files:

[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]$ 

However, if I add these files to the command line, I will get another error (symbols get duplicated), which I submitted in another question: can not use function as type in Go

So, somehow, with automatic build process Ethereum is compiled to include these variables (configFileFlag,initCommand, etc) but when I am trying to do it manually I am missing some stuff. But which stuff?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
    • ¥15 Python报错怎么解决
    • ¥15 simulink如何调用DLL文件
    • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
    • ¥30 线性代数的问题,我真的忘了线代的知识了
    • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
    • ¥188 需要修改一个工具,懂得汇编的人来。
    • ¥15 livecharts wpf piechart 属性
    • ¥20 数学建模,尽量用matlab回答,论文格式
    • ¥15 昨天挂载了一下u盘,然后拔了