Bitcoin QT debug commands

Screen Shot 2014-02-09 at 1.03.21 PM February 9th, 2014 5 minutes reading time.Tweet

If you are a Java developer used to the productivity levels achieved by working with eclipse’s code navigation, code completion and refactoring tools, it’s worth your time staying in eclipse for any sort of C++ development.

Before you start setting up eclipse, please make sure you can build Bitcoin from the command line, this way you know that you have everything necessary to build Bitcoin, even if you’re still getting a few errors showing in Eclipse, in the end Eclipse will be using the Makefiles provided by the project whenever we need to compile (and it can do so incrementally when possible saving you a lot of compilation time)

I’m assuming you have installed:
- eclipse
- eclipse CDT tools, up to date for the version of eclipse you’re working with (I’m still working with Juno)
- Qt/Eclipse plugin (optionally)
- All the dependencies (autoconf automake berkeley-db4 boost miniupnpc openssl pkg-config protobuf qt gdb) necessary to build Bitcoin which are easily installable via HomeBrew.

Screen Shot 2014-02-09 at 12.55.38 PM1. Let’s import the bitcoin/ project to our workspace.

File > Import > Existing Code as Makefile Project

Look for the bitcoin/ git checkout folder, and make sure you use the GNU Autotools Toolchain

2. Fixing the C++ compiler Path and Symbols.

Right click on the project containing folder in the Project Explorer > Properties.
Go to C/C++ General > Paths and Symbols > Languages: GNU C++ > “Includes” Tab and make sure it looks something like the screenshot below (I got those paths by looking at the ones used by the Makefiles in the Bitcoin. Hit Apply, OK, then wait for the reindexing, you might still have a few weird errors because of how the compiler checking settings are.

Screen Shot 2014-02-09 at 1.23.37 PM

3. Remove a few more issues like “Error: Invalid arguments candidates are: void resize(?, int)."

We open again the project Properties, this time we go to C/C++ General > Preproessor Include Paths, Macros, etc.
Click on the Providers tab and make sure “CDT GCC Built-in Compiler Settings [Shared]” is checked. Hit Apply, OK, wait for reindexing.
If there are still errors, you might want to just delete them and refresh the project (F5 on the project folder in the Project explorer), all errors should be gone by now.

Now start working just as fast as you’re used to with Java on Eclipse.

Screen Shot 2014-02-11 at 1.21.07 PM Screen Shot 2014-02-11 at 1.31.43 PM Screen Shot 2014-02-11 at 1.32.00 PM

Bitcoin QT rescan

Bitcoin QT bitcoind

Bitcoin-Qt debug console

Bitcoin QT new address

Bitcoin QT send from address