Developing with Ubuntu Qt Creator ToolChain for Angstrom Beaglebone (Arm Cortex-a8)
-
- get your angstrom cross compiler and cross compile Qt libs for your beaglebone target.
- install Qt libs on your target.
- use your cross compiler and cross compiled Qt libs on your desktop to cross compile your Qt app.
- deploy the app and run.
which step are you on?
-
*Right now I have a Desktop with Ubuntu and Qt Creator located on it, I thought this would be the best/eaiset route to cross compiler and develop(Even though I perfer C# over C++ Qt Creator will have to do as I read its easyest this way), If Qt Creator is a cross-compiler, how do I setup the cross compiling options for arm compliation?
*The target (Beaglebone) can use opkg (package manager) to install Qt libraries would compiling it by hand make it easier on me down the road when I'm executing code?
Lets just say Im at step one so we are on the same page from the get go.
Thank you for your time everyone :)
-
my suggestion is put Qt Creator to the side for now. focus on getting the Qt sources cross compiled. thats the biggest hill to get over.
download the latest sources from below and extract.
http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.3.tar.gzdo you have an Angstrom toolchain? do you have it extracted somewhere?
usually it will be extacted to either
/usr/local/angstrom/
or a newer toolchain
/usr/local/oecore-i686/ -or something similarangstrom comes with an environment file you can source to set environmental vars.
ex:
/usr/local/oecore-i686/environment-setup-armv7a-angstrom-linux-gnueabi
or
/usr/local/angstrom/arm/environment-setupsource that file.
ex:
source path/to/file
you should have the cross compiling binaries in your path. arm-angstrom-linux-*then your ready to start cross compiling Qt. let me know when your get there, or need help getting there.
-
you can get toolchains here:
http://www.angstrom-distribution.org/toolchains/you can get on with Qt 4.6.3. but cross compiling the latest version is a worth the effort.
one of the two is what you want.
http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain.tar.bz2
http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2 -
Qt Creator --- Ditched!
I downloaded qt-everywhere-opensource-src-4.8.3.tar.gz I have extracted on the Ubuntu computer.
I have downloaded the angstrom toolchain (x86_64 as I am on 64bit Ubuntu OS)
I was egar to extract it into some pseudo-system folders but I have done that now and extracted it into the / (root file system) as the .tar.bz2 came with two folder usr and var
I noticed that their is a enviroment-setup file located here /usr/local/angstrom/arm/enviroment-setup
Should I run that file?
-
now its time to start cross compiling Qt.
first goal is to just get a console based 'hello world' application on the target. so, not worried about gui or touchscreen features. you may have to come back to cross compile Qt later to add support for those. save those battles for another day.
go to the directory you extract Qt.
make a backup copy of the following file, and then edit the original.
$qtsource/mkspecs/qws/linux-arm-gnueabi-g++/qmake.confnotice things like the following:
QMAKE_CC = arm-angstrom-linux-gnueabi-gcc
QMAKE_CXX = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-angstrom-linux-gnueabi-g++
QMAKE_AR = arm-angstrom-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-angstrom-linux-gnueabi-objcopy
QMAKE_STRIP = arm-angstrom-linux-gnueabi-stripmake sure 'arm-angstrom-linux-gnueabi-*' matches what you have installed for your toolchain. edit if needed.
configure Qt with the following in the root of the extracted Qt source.
@
./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -host-big-endian -prefix /usr/local/beaglebone/qt4.8-arm -no-cups -no-accessibility -reduce-relocations -no-nas-sound -no-sm -no-nis -qt-libjpeg -qt-libpng -qt-zlib -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-pch -no-dbus -no-glib -no-phonon -no-phonon-backend -no-webkit -no-multimedia -no-audio-backend -no-qt3support -nomake examples -nomake demos -nomake docs -nomake translations -no-qt3support -exceptions -no-fast
@
that is a configuration that worked for me in the past. let me know if you get errors.
pay special attention to:
-xplatform qws/linux-arm-gnueabi-g++
and
-prefix /usr/local/beaglebone/qt4.8-armxplatform tells configure which qmake.conf you want to use, the one you edited above.
prefix tells configure where you want Qt libs installed on your desktop, this will be the same directory you will copy Qt libs to on your target. -
I got up to the configure part and these are the last few lines I got in error:
@ from /home/xenland/qt-everywhere-opensource-src-4.8.3/src/corelib/io/qfilesystementry.cpp:46:
/home/xenland/qt-everywhere-opensource-src-4.8.3/include/QtCore/private/../../../src/corelib/io/qfilesystemmetadata_p.h:228: error: expected ',' or '...' before '&' token
/home/xenland/qt-everywhere-opensource-src-4.8.3/include/QtCore/private/../../../src/corelib/io/qfilesystemmetadata_p.h:228: error: ISO C++ forbids declaration of 'QT_DIRENT' with no type
make: *** [qfilesystementry.o] Error 1@ -
Updates: I logged in as Sudo -s and got a different error similar to "this one":http://stackoverflow.com/questions/8168950/cross-compiling-c-project-relocations-in-generic-elf-em-3 wit hthe EF 50's errors
So I did the export thing wit hthe correct file paths and then ran the ./configure --etc -etc again and now I get the same error except it looks cleaner in text style this time like the following...
@
Creating qmake. Please wait...
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++ -o "/home/xenland/qt-everywhere-opensource-src-4.8.3/bin/qmake" project.o property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfile.o qfilesystementry.o qfilesystemengine_unix.o qfilesystemengine.o qfilesystemiterator_unix.o qfsfileengine_unix.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o
qfilesystementry.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [/home/xenland/qt-everywhere-opensource-src-4.8.3/bin/qmake] Error 1
root@000000000:~/qt-everywhere-opensource-src-4.8.3#
@ -
ok. all was fine for me. i'm using ubuntu (32 bit), same qt source and toolchain as you. so i prolly didn't explain as step that good.
- source your toolchain env file:
source /usr/local/angstrom/arm/environment-setup - confirm arm binaries are in your PATH env. from any directory type:
arm-angstrom and hit tab a few times. auto complete should show you a bunch file files named arm-angstrom-linux-gnueabi-something - setup your mkspecs. delete everything in the following file:
/home/xenland/qt-everywhere-opensource-src-4.8.3/mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf
copy in the following:
@#qmake configuration for building with arm-none-linux-gnueabi-g++
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)modifications to g++.conf
QMAKE_CC = arm-angstrom-linux-gnueabi-gcc
QMAKE_CXX = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-angstrom-linux-gnueabi-g++modifications to linux.conf
QMAKE_AR = arm-angstrom-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-angstrom-linux-gnueabi-objcopy
QMAKE_STRIP = arm-angstrom-linux-gnueabi-stripload(qt_config)
@
- cd to /home/xenland/qt-everywhere-opensource-src-4.8.3/ and run the following command:
@./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -host-big-endian -prefix /usr/local/beaglebone/qt4.8-arm -no-cups -no-accessibility -reduce-relocations -no-nas-sound -no-sm -no-nis -qt-libjpeg -qt-libpng -qt-zlib -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-pch -no-dbus -no-glib -no-phonon -no-phonon-backend -no-webkit -no-multimedia -no-audio-backend -no-qt3support -nomake examples -nomake demos -nomake docs -nomake translations -no-qt3support -exceptions -no-fast
@
i usually just copy the configure command into a file called config in the source directory, and chmod 755, and run the file ./config
hopefully you don't get any errors, and then you can run:
make
if you have a mutiple core cpu, you can run: make -j2, or make -j4 to speed things up.then
sudo make install - source your toolchain env file:
-
[quote author="blaroche" date="1350091911"]
@
./configure ... -embedded arm -little-endian -host-big-endian ...
@
[/quote][quote author="NuckNuck" date="1350093758"]
@
qfilesystementry.o: file not recognized: File format not recognized
@
[/quote]
...isn't x86_64 little-endian? -
[quote author="NuckNuck" date="1350093758"]
...isn't x86_64 little-endian?[/quote]
i've never tried on a 64bit machine, good suggestion, thank you.
try this configure.
but first, cleanup. run
make confclean./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -host-little-endian -prefix /usr/local/beaglebone/qt4.8-arm -no-cups -no-accessibility -reduce-relocations -no-nas-sound -no-sm -no-nis -qt-libjpeg -qt-libpng -qt-zlib -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-pch -no-dbus -no-glib -no-phonon -no-phonon-backend -no-webkit -no-multimedia -no-audio-backend -no-qt3support -nomake examples -nomake demos -nomake docs -nomake translations -no-qt3support -exceptions -no-fast
-
I did * make confclean* which make claimed it couldn't find any target file/config so i just did the ./configure above with the last post that includes the little-endian flag and now I recieve this error, Thanks again for the help I'm excited to get to BeagleBone programming
_
root@000000000:~/qt-everywhere-opensource-src-4.8.3# ./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -host-big-endian -prefix /usr/local/beaglebone/qt4.8-arm -no-cups -no-accessibility -reduce-relocations -no-nas-sound -no-sm -no-nis -qt-libjpeg -qt-libpng -qt-zlib -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-pch -no-dbus -no-glib -no-phonon -no-phonon-backend -no-webkit -no-multimedia -no-audio-backend -no-qt3support -nomake examples -nomake demos -nomake docs -nomake translations -no-qt3support -exceptions -no-fast
Determining system architecture... (Linux:3.2.0-32-generic:x86_64)
64-bit AMD 80x86 (x86_64)
'arm' is supported
'x86_64' is supported
System architecture: 'arm'
Host architecture: 'x86_64'You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
dependenciesSymbol visibility control enabled.
Symbolic function binding enabled.This is the Qt for Embedded Linux Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.You have already accepted the terms of the license.
Creating qmake. Please wait...
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-g++ -c -o option.o -pipe -m64 -DQMAKE_OPENSOURCE_EDITION -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerators/integrity -I/home/xenland/qt-everywhere-opensource-src-4.8.3/include -I/home/xenland/qt-everywhere-opensource-src-4.8.3/include/QtCore -I/home/xenland/qt-everywhere-opensource-src-4.8.3/src/corelib/global -I/home/xenland/qt-everywhere-opensource-src-4.8.3/src/corelib/xml -I/home/xenland/qt-everywhere-opensource-src-4.8.3/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/xenland/qt-everywhere-opensource-src-4.8.3/mkspecs/qws/linux-x86_64-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED option.cpp
cc1plus: error: unrecognized command line option "-m64"
make: *** [option.o] Error 1
_ -
Hmm... Google suggests that the "-m64" is not supported by these cross-compilers. I don't have a 64-bit machine, so I'm not sure where that is being set.
Go to your Qt root folder and call this to find out:
@
grep m64 *
@You might be able to manually remove the flag and continue.
-
hmm. lets go back and see if we can find a smaller configure that you can build on.
see where you get with this one:
@./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -host-big-endian -prefix /usr/local/beaglebone/qt4.8-arm @then maybe try this:
@./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -prefix /usr/local/beaglebone/qt4.8-arm @i'm with JSKH, i've never cross compiled on 64 bit.
-
[quote author="blaroche" date="1350134211"]hmm. lets go back and see if we can find a smaller configure that you can build on.
see where you get with this one:
@./configure -v -opensource -confirm-license -xplatform qws/linux-arm-gnueabi-g++ -embedded arm -little-endian -host-big-endian -prefix /usr/local/beaglebone/qt4.8-arm @
[/quote]That first configure seems to have done the trick, This was the end result
@
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into /usr/local/beaglebone/qt4.8-armTo reconfigure, run 'make confclean' and 'configure'.
@So i ran make and recieved the following error
@make[1]: arm-none-linux-gnueabi-g++: Command not found
make[1]: *** [.obj/release-shared-emb-arm/qabstractanimation.o] Error 127
make[1]: Leaving directory `/home/xenland/qt-everywhere-opensource-src-4.8.3/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2@Its odd that it says its trying to execute arm-none-linux-gnueabi-g++