I wanted to build go-ethereum source code in my local side and test it in geth. I have followed up the instructions in the github go-ethereum as it is. However, I have got fail with some errors when I try command to build as below.

go-ethereum>go install -v github.com/ethereum/go-ethereum/cmd/geth

Is there any ways to build go-ethereum source code on either windows or ubuntu? I have tested it in both windows10 and Ubuntu18.04 with go version 1.13.4.

  • What are the errors? – Linmao Song Dec 3 '19 at 12:33
  • My build command is as follows. C:\Users\Jon\go\src\github.com\ethereum\go-ethereum>go install -v github.com/ethereum/go-ethereum/cmd/geth – JongH Dec 3 '19 at 20:47
  • C:/TDM-GCC-64/x86_64-w64-mingw32/include/oledlg.h:428:3: error: unknown type name 'interface' ECLARE_INTERFACE_(IOleUILinkContainerW,IUnknown) { C:/TDM-GCC-64/x86_64-w64-mingw32/include/oledlg.h:428:3: error: expected '=', ',', ';', 'asm' or 'attribute' before '{' token DECLARE_INTERFACE_(IOleUILinkContainerW,IUnknown) { In file included from C:/TDM-GCC-64/x86_64-w64-mingw32/include/setupapi.h:27:0, from ..\..\..\..\pkg\mod\github.com\karalabe\usb@v0.0.0-20190919080040-51dc0efba356\libusb\libusb/os/windows_winusb.c:29,from – JongH Dec 3 '19 at 20:54
  • Errors are like above which are not whole error messages. This errors are same from on both windows10 and Ubuntu18.04. – JongH Dec 3 '19 at 22:20

Those instructions work for me on Ubuntu 18.04. I'm assuming it's something to do with your Go installation (or a missing/out-of-date C compiler?).

Another, make-based, method (which again works for me on Ubuntu) is the following:

  • git clone https://github.com/ethereum/go-ethereum
  • Install the latest version of Go
  • sudo apt-get install -y build-essential
  • cd go-ethereum
  • make geth
  • I have tried the command "make geth", but it does not work. How does it work the make commands? – JongH Dec 3 '19 at 20:44
  • I have successfully build on Mac for the same source code, but I have error on header files in both windows and ubuntu. – JongH Dec 4 '19 at 4:46
  • It looks like you might be hitting this issue: github.com/ethereum/go-ethereum/issues/20093 – Richard Horrocks Dec 4 '19 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.