Cross-compiling RPi application using Qt Creator
-
For building windows tools, manual specifies the following command:
mkdir qt-build cd qt-build ../qt-everywhere-opensource-src-5.5.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -opengl es2 -device linux-rasp-pi2-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5
For RPi3 device I should probably use linux-rasp-pi-g++ instead of linux-rasp-pi2-g++. Correct ?
-
Here is the message what I get after executing build command:
The OpenGL ES 2.0 functionality test failed! Use of pkg-config is not enabled, maybe you want to pass -force-pkg-config? You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in c:/Users/pyo/Downloads/qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/devices/linux-rasp-pi-g++.
Any ideas ?
-
Device should be
linux-rasp-pi3-g++
or if you want EGLFS with full OpenGL support,linux-rasp-pi3-vc4-g++
-
Oh, Qt 5.5? Yes, that came out before Raspberry Pi 3 was on the market. I strongly recommend compiling a more modern version of Qt. Even Raspbian OS (which is veeery outdated) ships Qt 5.7...
-
I took source from here:
qt-everywhere-src-5.12.3
Can you provide link with more recent version.
Thanks -
I took source from here:
qt-everywhere-src-5.12.3
Can you provide link with more recent version.
Thanks -
So, what about original problem: what location use in bulding command - linux-rasp-pi-g++ or linux-rasp-pi2-g++ ?
@Pavel_47 said in Cross-compiling RPi application using Qt Creator:
So, what about original problem: what location use in bulding command - linux-rasp-pi-g++ or linux-rasp-pi2-g++ ?
All your input so far suggest you are actually compiling Qt 5.5. Please make sure you're working with the 5.12.3 source you downloaded.
-
Yes !!! Misunderstanding with my colleague - I believed that folder qt-everywhere-opensource-src-5.5.0 corresponds to the latest source of Qt. Indeed there are new device folder that correspond to RPi3: linux-rasp-pi3-g++ and linux-rasp-pi3-vc4-g++. What is the difference between them ?
Thanks. -
Yes !!! Misunderstanding with my colleague - I believed that folder qt-everywhere-opensource-src-5.5.0 corresponds to the latest source of Qt. Indeed there are new device folder that correspond to RPi3: linux-rasp-pi3-g++ and linux-rasp-pi3-vc4-g++. What is the difference between them ?
Thanks. -
Error while building !
Preparing build tree... Creating qmake... ..............................c:/Users/pyo/Downloads/qt-everywhere-src-5.12.3/qtbase/src/corelib/global/qglobal.cpp: In function 'QString qEnvironmentVariable(const char*, const QString&)': c:/Users/pyo/Downloads/qt-everywhere-src-5.12.3/qtbase/src/corelib/global/qglobal.cpp:3346:49: error: '_wgetenv_s' was not declared in this scope _wgetenv_s(&requiredSize, 0, 0, wname.data()); ^ make.exe: *** [qglobal.o] Error 1
-
On this link the author propose a workaround (although I'm not sure if this workaround is valid for my case).
Anyway I've added this instruction (i.e. defined MINGW_HAS_SECURE_API flag as suggested)
DEFINES += UNICODE _UNICODE WIN32 MINGW_HAS_SECURE_API=1
in ...\win32-g++\qmake.conf
Unfortunately it didn't help -
Well, I reported this issue as bug on
https://bugreports.qt.io/ -
Sounds like something that would not happen on Linux. I have never encountered this error, so I can only wish you luck :D
-
@Pavel_47 you may want to try this guide, in particular the section to setup Qt Creator
@Pablo-J.-Rogina said in Cross-compiling RPi application using Qt Creator:
@Pavel_47 you may want to try this guide, in particular the section to setup Qt Creator
Well, having problem with building toolchain under Windows, I decided to switch to Linux.
But in Linux I've also met problem while configuring Qt. Here is the result if executing ./configure:Project ERROR: Cannot run target compiler 'g++'. Output: =================== Using built-in specs. COLLECT_GCC=g++ g++: error: unrecognized command line option '-mfpu=crypto-neon-fp-armv8' g++: error: unrecognized command line option '-mfloat-abi=hard' Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) =================== Maybe you forgot to setup the environment?
-
@Pablo-J.-Rogina said in Cross-compiling RPi application using Qt Creator:
@Pavel_47 you may want to try this guide, in particular the section to setup Qt Creator
Well, having problem with building toolchain under Windows, I decided to switch to Linux.
But in Linux I've also met problem while configuring Qt. Here is the result if executing ./configure:Project ERROR: Cannot run target compiler 'g++'. Output: =================== Using built-in specs. COLLECT_GCC=g++ g++: error: unrecognized command line option '-mfpu=crypto-neon-fp-armv8' g++: error: unrecognized command line option '-mfloat-abi=hard' Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) =================== Maybe you forgot to setup the environment?
@Pavel_47 said in Cross-compiling RPi application using Qt Creator:
gcc version 4.8.4
Ancient stuff... I hope RPi will update their toolchain finally some day.
--target=x86_64-linux-gnu
Looks like you are not building for ARM. Either wrong toolchain or wrong
./configure
flags. -
Here is configure I've just used:
./configure -release -opengl es2 -device linux-rasp-pi3-vc4-g++ -device-option CROSS-COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v