Building and setting up QT environment for BeagleBone

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”

转载于:https://www.cnblogs.com/dolphi/p/3613068.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值