src/qt/README.md is unclear/incomplete regarding "Setup Qt Creator" #240

issue benliepert opened this issue on March 5, 2021
  1. benliepert commented at 4:53 PM on March 5, 2021: none

    I'm going through the gui/src/qt/README.md to set up a development environment in Ubuntu. I had 2 issues:

    1. I got errors for every "#include <qt/. . .>". I believe this is because creator has no sense of where the qt directory is when it's the absolute path of the project (step 4), as the root directory of the project is named "bitcoin-qt". Removing "qt/" from relevant includes, or importing the project with absolute path of gui/ or gui/src resolves this.

    2. I got "file not found" errors for all of the Qt core #includes (QApplication, QDebug, QSettings, etc)

    For what it's worth, I had identical behavior in Arch Linux.

  2. hebasto commented at 5:17 PM on March 5, 2021: member
  3. hebasto added the label Doc on Mar 5, 2021
  4. jarolrod commented at 8:21 PM on March 5, 2021: member

    Just went through the whole build process and qtcreator set up on a clean install of Ubuntu 20.04.1. Tested that I can run the executable from qtcreator, I can make changes and build with qtcreator. Cannot replicate the errors described.

    Screen Shot 2021-03-05 at 3 08 28 PM

    Here are some notes on setting up the project in qt creator:

    • you must build bitcoin before importing the project into qtcreator
    • when building bitcoin and you get to the configure stage, add the --enable-debug flag
    • At Step 4, you must enter the absolute path to the qt director: /home/{USER}/gui/src/qt
    • Leave the default include files as is! You may need to re-select the forms folder to ensure the ui files are included (if you wish to edit those), that's all.
    • Make sure that you go to Projects -> Manage Kits and verify that the correct values are selected as described in step 7

    Performing these steps should get you up and running. After verifying these steps, please let us know if this is still a problem.

  5. benliepert commented at 10:32 PM on March 5, 2021: none

    I tried with a clean install of Ubuntu 20.04 (virtualbox 6.1.18). I am able to build and run without issues in qtcreator. However, I have the same errors for almost every include:

    file-not-found

    This is my full system history:

        1  reboot
        2  sudo apt install gcc make
        3  cd /media/ben/
        4  ll
        5  cd VBox_GAs_6.1.18/
        6  ll
        7  ./VBoxLinuxAdditions.run 
        8  sudo ./VBoxLinuxAdditions.run 
        9  shutdown now
       10  sudo apt install git
       11  git clone git@github.com:bitcoin-core/gui.git
       12  git clone https://github.com/bitcoin-core/gui.git
       13  cd gui/
       14  ll
       15  sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
       16  sudo apt-get install libevent-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev
       17  sudo apt install libsqlite3-dev
       18  sudo apt install libminiupnpc-dev libnatpmp-dev
       19  sudo apt-get install libzmq3-dev
       20  sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools
       21  sudo apt-get install libqrencode-dev
       22  ./contrib/install_db4.sh `pwd`
       23  history
       24  export BDB_PREFIX='/home/ben/gui/db4'
       25  ./autogen.sh
       26  ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --enable-debug
       27  make -j6
       28  sudo apt install qtcreator
       29  qtcreator &
    

    After that, import existing project, title "bitcoin-qt", path /home/ben/gui/src/qt. Selected the forms folder and added to git. Compilers (GCC), debugger (GDB) and executable are set.

    This is what my end of my ./configure output looks like:

    Build Options:
      with ecmult precomp     = yes
      with external callbacks = no
      with benchmarks         = no
      with tests              = yes
      with openssl tests      = no
      with coverage           = no
      module ecdh             = no
      module recovery         = yes
      module extrakeys        = yes
      module schnorrsig       = yes
    
      asm                     = x86_64
      bignum                  = no
      ecmult window size      = 15
      ecmult gen prec. bits   = 4
    
      valgrind                = no
      CC                      = gcc
      CFLAGS                  = -O2 -fvisibility=hidden -std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings -W -g
      CPPFLAGS                = 
      LDFLAGS                 = 
    
    
    Options used to compile and link:
      external signer = no
      multiprocess    = no
      with libs       = yes
      with wallet     = yes
        with sqlite   = yes
        with bdb      = yes
      with gui / qt   = yes
        with qr       = yes
      with zmq        = yes
      with test       = yes
      with bench      = yes
      with upnp       = yes
      with natpmp     = yes
      use asm         = yes
      ebpf tracing    = no
      sanitizers      = 
      debug enabled   = yes
      gprof enabled   = no
      werror          = no
    
      target os       = linux
      build os        = linux-gnu
    
      CC              = gcc
      CFLAGS          = -pthread -g -O2
      CPPFLAGS        =  -DDEBUG -DDEBUG_LOCKORDER -DABORT_ON_FAILED_ASSUME   -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DPROVIDE_FUZZ_MAIN_FUNCTION
      CXX             = g++ -std=c++17
      CXXFLAGS        =  -O0 -g3 -ftrapv  -fstack-reuse=none -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection  -Wall -Wextra -Wformat -Wformat-security -Wvla -Wswitch -Wredundant-decls -Wunused-variable -Wdate-time -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Woverloaded-virtual -Wsuggest-override  -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-deprecated-copy    -fno-extended-identifiers
      LDFLAGS         = -lpthread  -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -pie  
      ARFLAGS         = cr
    
  6. jarolrod commented at 10:35 PM on March 5, 2021: member

    In project->manage kits, what do you see under Qt versions?

  7. benliepert commented at 10:37 PM on March 5, 2021: none

    Under Manage Kits...->Kits->Desktop (default)-> Qt version: Qt 5.12.8 in PATH (System) There's also an option for Qt 5.12.8 in PATH (qt5)

  8. jarolrod commented at 10:46 PM on March 5, 2021: member

    @benliepert confirming I can replicate the issue with includes, #1 in OP is fixed by using gui/ as root instead of gui/src/qt, #2 is still an issue and may require what the OP states

  9. benliepert commented at 2:23 AM on March 6, 2021: none

    I'm editing my initial comment to avoid confusion, as I was wrong about resolving #2: it seems some Qt constructs aren't found/known but I can't see a consistent pattern

  10. jarolrod commented at 5:52 PM on May 1, 2021: member

    @hebasto I think this can be closed.

    Upon the removal of the bitcoin-qt.pro file in https://github.com/bitcoin/bitcoin/pull/21695, it can be said that we do not actively promote the use of Qt Creator as an IDE. That being said it does provide a convenient way to make changes to the *.ui files, and the current instructions will get you to a point where you can do so.

  11. hebasto closed this on May 8, 2021

  12. bitcoin-core locked this on Aug 16, 2022
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me