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
Download angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 for 64bit host or angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2 for x86 (or download more recent version at http://www.angstrom-distribution.org/toolchains/). (The Angstrom website is down for 3 weeks – meanwhile you can download the required toolchains from my gdrive –https://googledrive.com/host/0B3Z340LOBulvMG5NRmNlZEppSEE)- Run
$ tar -C / -xjf angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6..tar.bz2
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..tar.gz
$ mv qt-everywhere-opensource-src-4.8. qt-4.8.-beagle
4. Create qmake.conf
$ cd qt-4.8.-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:
#
# qmake configuration for building with arm-linux-g++
# include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf) # modifications to g++.conf
#Toolchain #Compiler Flags to take advantage of the ARM architecture
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++ # modifications to linux.conf
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip load(qt_config)
5. Configure QT embedded
./configure -v -opensource -confirm-license -prefix /opt/qt -embedded arm -platform qws/linux-x86-g++ -xplatform qws/linux-am335x-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast -little-endian -host-big-endian -no-pch -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-webkit -no-qt3support -nomake examples -nomake demos -nomake docs -nomake translations
6. Build and install
$ make -j
$ 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:
root@beaglebone:/# mkdir /opt
root@beaglebone:/# mkdir /opt/qt - Copy lib from your host to beagle:
$ scp -r /opt/qt/lib root@192.168.7.2:"/opt/qt"
- Add the lib directory to path by editing /etc/profile and adding:
PATH="...:/opt/qt/lib"
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
chmod +x qt-creator-linux-x86_64-opensource-2.8..run
./qt-creator-linux-x86_64-opensource-2.8..run- Follow installation Wizard
- Run Angstrom toolchain environment setup:
$ . /usr/local/angstrom/arm/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:
target.files = <YOUR EXECUTABLE NAME>
target.path = /home/root
INSTALLS = target - 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:
#include <QCoreApplication>
#include <iostream> int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv); std::cout << "hello world" << std::endl; return a.exec();
}
Good luck!
Meir Tseitlin
This entry was posted in Beaglebone, Linux Embedded, QT by Miro. Bookmark the permalink.
71 THOUGHTS ON “BUILDING AND SETTING UP QT ENVIRONMENT FOR BEAGLEBONE”
Building and setting up QT environment for BeagleBone的更多相关文章
- Storm(1) - Setting Up Development Environment
Setting up your development environment 1. download j2se 6 SDK from http://www.oracle.com/technetwor ...
- Qt新安装之后出现Error while building/deploying (kit: Desktop Qt 5.7.0 GCC 64bit) When executing step "Make”
Ubuntu14.04初次安装Qt之后可能出现Error while building/deploying project *** (kit: Desktop Qt 5.7.0 GCC 64bit ...
- [SystemC] Setting Up the Environment
My operating system is Ubuntu 12.04. 0. Checking Your Compilers First thing first, you will need the ...
- Qt.Qt新安装之后出现Error while building/deploying (kit: Desktop Qt 5.7.0 GCC 64bit) When executing step "Make”
出问题的环境: 操作系统: Ubuntu18.04 安装包: qt-opensource-linux-x64-5.8.0.run 现象: 新建一个Hello World项目, 试着运行, 出现以下提示 ...
- Glibc编译报错:*** LD_LIBRARY_PATH shouldn't contain the current directory when*** building glibc. Please change the environment variable
执行glibc编译出错如下图 [root@localhost tmpdir]# ../configure --prefix=/usr/loacl/glibc2.9 --disable-profile ...
- qt-5.6.0 移植之qt源码编译
其实这只是给自己看的一个configure选项笔记,没有太多的东西. 首先: 下载qt5.6的源码: 地址: http://download.qt.io/archive/qt/5.6/ 下载完解压: ...
- How to build a GUI in ROS with Qt / C++
p { margin-bottom: 0.1in; direction: ltr; line-height: 120%; text-align: left; widows: 2; orphans: 2 ...
- Qt Creator编译问题
有时候需要自己编译Qt Creator,需要注意的就是qmake版本的问题,比如我用4.8.1和4.8.6同样编译出来的Qt Creator在同样的qtconfig-qt4下所呈现的效果是不一样的. ...
- This page is about building Firefox Desktop
This page is about building Firefox Desktop The Mozilla build system, like the rest of the Mozilla c ...
随机推荐
- 【图片处理】cocos2dx png图片压缩处理
一.介绍 美术用photoshop出图有时候会包含一些无用的信息,这时候image magick可以把这些信息裁掉. 二.使用方法 1.下载并安装Image Magick 2.将脚本里的目录名改成Im ...
- 【HDOJ】5564 Clarke and digits
DP+快速矩阵幂.注意base矩阵的初始化,不难. /* 5564 */ #include <iostream> #include <string> #include < ...
- BZOJ_1221_ [HNOI2001]_软件开发(最小费用流,网络流24题#10)
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1221 n天,每天需要r个毛巾,用完以后可以洗,要么花fa洗a天,要么花fb洗b天,毛巾不够了可 ...
- php加速缓存Xcache的安装与配置
安装环境:centos 6.5 32bit php5.5.7 nginx1.6.0 [root@localhost opt]# wget http://xcache.lighttpd.net/pub ...
- sdfsdf
http://www.cocoachina.com/bbs/read.php?tid-234704.html 选择工程->Build Settings -> Code Signing -& ...
- dtree的使用
第一步:到官网下载下载dtree的相关包. 第二步:导入相关包 <link rel="StyleSheet" href="${ctx}/dtree/dtree. ...
- Android批量插入数据到SQLite数据库
Android中在sqlite插入数据的时候默认一条语句就是一个事务,因此如果存在上万条数据插入的话,那就需要执行上万次插入操作,操作速度可想而知.因此在Android中插入数据时,使用批量插入的方式 ...
- 从修复 testerhome(rubychina)网站的一个 bug 学习 ruby&rails on ruby
前言 testerhome: http://testerhome.com/topics/1480 对于一个差点脱离前沿技术人,想要学习ruby,就意味着要放弃熟悉的操作系统windows,熟悉的ide ...
- EF架构随心所欲打造属于你自己的DbModel【转】
前言 我们都知道EF可以生成Dbmodel,系统生成的Model有时候并不是我们想要的,如何我们要生成自己的Model,那么久需要我们手动的去修改T4模版,T4是对“Text Template Tra ...
- [TOP]疯狂的投资
[TOP]疯狂的投资 这是罗辑思维一期<疯狂的投资>的节目笔记,这期主要是通过菲尔德铺设横跨大西洋的电缆的故事讲了创业者需要的特质和<二十一世纪资本论>的一个观念:随着自由市场 ...