Building and setting up QT environment for BeagleBone

时间:2021-07-14 02:49:38

There are too few information available on how to easily setup QT environment for building Beaglebone applications (command line or GUI). In this tutorial we will compile QT and setup the environment from scratch.

1. My environment

  • Host: Ubuntu 12.10 32bit (VMplayer)
  • Target: BeagleBone Black running Angstrom
  • QT: 4.8.5

2. Setup Angstrom cross-compile toolchain for Linux

3. Download and un-tar QT

 

$ wget http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
$ tar -xzf qt-everywhere-opensource-src-4.8.5.tar.gz
$ mv qt-everywhere-opensource-src-4.8.5 qt-4.8.5-beagle

 

 4. Create qmake.conf

$ cd qt-4.8.5-beagle
$ mkdir ./mkspecs/qws/linux-am335x-g++ 
$ cp ./mkspecs/qws/linux-arm-g++/qplatformdefs.h ./mkspecs/qws/linux-am335x-g++ 
$ touch ./mkspecs/qws/linux-am335x-g++/qmake.conf

 

Add the following to qmake.conf with your favorite editor:

 

 5. Configure QT embedded

 6. Build and install

 

$ make -j 4
$ sudo make install

 

“-j 4″ will run the long build process reusing 4 CPU cores, you can change to your own CPU cores amount.

7. Install Qt SDK (lib) we built previously on your board

  • Make sure you beaglebone is connected to your host
  • ssh to your beagle (ssh root@192.168.7.2)
  • Create dir structure from your prefix:
  • Copy lib from your host to beagle:
  • Add the lib directory to path by editing /etc/profile and adding:

8. Download, install and configure QT Creator

  • I suggest installing QT Creator using regular installer:
  • Download qt-creator-linux-x86-opensource-2.8.0.run for x86 or qt-creator-linux-x86_64-opensource-2.8.0.run for 64bit
  • Follow installation Wizard
  • Run Angstrom toolchain environment setup:
  • Open Qt Creator and
  • Configure Qt version
  • Go to Tools->Options->Build & Run->Qt Versions and click Add
  • Select qmake.conf from /opt/qt/bin
  • Click Ok
  • Configure target device connection
  • Go to Tools->Options->Devices
  • Click Add and select Generic Linux Device
  • Add IP 192.168.7.2, User: root
  • Set name to “Beaglebone”
  • Click Ok
  • Configure Compiler
  • Go to Tools->Options->Build & Run->Compilers and click Add->GCC
  • Select compiler path: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++
  • Click Ok
  • Configure Kit
  • Go to Tools->Options->Build & Run->Kits and click Add
  • Call new kit Beaglebone
  • Select device type: “Generic Linux Device”
  • Select the device you previously created
  • Select compiler you created
  • Select Qt version you created
  • Select GDK path as /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gdk
  • Click Ok

 9. Build Qt application

  • Create new project (File->New project->Qt Project->Qt Console application)
  • Edit your project (.pro) file
  • Add the following after “TARGET=…” line:
  • Go to Projects -> Run, you should see on “Files to deploy” table your “target” settings
  • Now you are ready to build and deploy you project on your target board
  • The following example application should print Hello world inside your console:

     

Good luck!

Meir Tseitlin

This entry was posted in BeagleboneLinux EmbeddedQT by Miro. Bookmark the permalink.

71 THOUGHTS ON “BUILDING AND SETTING UP QT ENVIRONMENT FOR BEAGLEBONE