VoCore2: Develop on Qt Creator

For the people who do not like Java, now we can use Qt creator to make and debug our application remotely instead of Eclipse.

First, better to use 20190127.bin or later version as your firmware, after the tutorial, once you connect VoCore2 to internet, it is easy for you to download applications from openwrt.

We need to install some packages on VoCore2:

opkg install openssh-sftp-server
opkg install libstdcpp
opkg install gdbserver

Now VoCore has setup.

Let’s setup Qt and openwrt on your PC.

  1. We need to patch gdb, I have submitted the patch to github.com/vonger/vocore2, just do all the compile as Beginner Tutorial, it will be ready.
  2. Install gdb. Ye, it is right, if we do not install gdb there will missing some package.
    1. goto path/to/openwrt/build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/gdb-8.0.1
    2. call “make install”
  3. Make and install Qt.
    1. in make menuconfig -> Library -> Qt5, you can select qt5-core, and ‘M’ is OK, it is pretty big, so do not select as ‘*’
    2. make everything, takes pretty long time.
    3. goto path/to/build_dir/target-mipsel_24kc_musl/qt-everywhere-opensource-src-5.9.7
    4. call “make install”

Final step, setup Qt creator on your PC(path is just example, use your path of openwrt).

    1. Qt Creator -> Preferences -> Devices -> Devices -> Add -> Generic Linux Device
      • Name: VoCore2
      • Authentcation Type: Password
      • Host name:
      • SSH port: 22
      • Username: root
      • Password: vocore
    2. Qt Creator -> Preferences -> Kits -> Compilers -> Add -> GCC -> for both C/C++
      • Name: VoCore2 GCC and VoCore2 G++
      • Compiler path (GCC): openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc
      • Compiler path (G++): openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-g++
    3. Qt Creator -> Preferences -> Kits -> Compilers -> Debuggers -> Add
      • Name: VoCore2 GDB
      • Path: path/to/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-gdb
    4. Qt Creator -> Preferences -> Kits -> Qt Versions -> Add.
      • Version Name: Qt 5.9.7 for VoCore2 mips
      • qmake location: path/to/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/qmake
    5.  Qt Creator -> Preferences -> Kits -> Kits -> Add.
      • Name: VoCore2 Qt 5.9.7 (gcc OpenWrt mips)
      • Device Type: Generic Linux Device
      • Device: Generic Linux Device (default for Generic Linux)
      • Compiler: C, VoCore2 GCC; C++, VoCore2 G++
      • Debugger: VoCore2 GDB
      • Qt version: Qt 5.9.7 for VoCore2 mips

Then create a project, in .pro file, add this lines:

target.path = /tmp
INSTALLS += target

Then you can debug it as your other Qt application.

note: for macos, you need to install texinfo, or gdb will fail to install.