I have watched your latest videos about Qt for Raspberry several times and I would like you to record a new video with Qt6. Today is a special day that my wish was granted. Thank you, I'm actually watching the video! I enjoy!
After many hours of surfing the web to find out how to cross compile Qt6 (every tutorial is for Qt5.x) for the RasPi your video saved me! Please keep these going, especially with the submodules and EGLFS, and if that is possible to run a Qt6 application full screen on the Raspberry Pi 4 without the X11 GUI so directly using the OpenGL module. Thank you!
for people getting ERROR: The OpenGL functionality tests failed! 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 the mkspec for your platform. i also had the same problem, you probably forgot to change the set(TARGET_SYSROOT /home/ulas/rpi-sdk/sysroot) in the toolchain. Delete the qt-cross and repeat the steps again: $ cd .. $ mkdir qt-cross $ cd !$ then when creating the toolchain file make sure to change the set(TARGET_SYSROOT /home/**here your folder**/rpi-sdk/sysroot) and save $ tar xf ../qtbase-everywhere-src-6.3.0.tar.xz -change the **here your folder** in the next command $cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_FEATURE_eglfs_egldevice=ON -DQT_FEATURE_eglfs_gbm=ON \ -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF \ -DQT_HOST_PATH=/home/**here your folder**/qt6Host -DCMAKE_STAGING_PREFIX=/home/**here your folder**/qt6rpi \ -DCMAKE_INSTALL_PREFIX=/home/**here your folder**/qt6crosspi -DCMAKE_PREFIX_PATH=/home/**here your folder**/rpi-sdk/sysroot/usr/lib/ \ -DCMAKE_TOOLCHAIN_FILE=/home/**here your folder**/qt-cross/toolchain.cmake /home/**here your folder**/qt-cross/qtbase-everywhere-src-6.3.0/ you should get a similar summer to the one shown in the video. most important is this part it should be similar: OpenGL: Desktop OpenGL ....................... yes OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes this should solve it. hope it helps very much thanks @Ulas your video is great! its way better than the official qt installation
Just a note on the cross compilation , specifically on the host compilation of Qt - when trying the following command: cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DINPUT_opengl=es2 -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/ulas/qt6Host CMake hit a segmentation fault and could not move on. This was due to building straight from the source which was breaking CMake. The solution was to remove the source build and reinstall the latest stable releast from apt: sudo apt install cmake
Thanks for info, did you build the cmake with latest source or with the commit which is in the github page ? When I was working on it, cmake ,which was installed from apt, was not working.
unfortunately I get this error, I don’t understand what could have missed: ERROR: The OpenGL functionality tests failed! 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 the mkspec for your platform. I think it’s because I have a 64bit image
I tried exactly the same steps, including using ulas as user when creating the VM so I didn't have to change anything of the code-snippets and got exactly the same error when configuring the qt-cross part with cmake. Any ideas? no other guide including the official one has worked for me yet.
Ulaş bey iyi çalışmalar, Windows veya linux tarafında opencv içeren C++ kodları yazıp, bunu Beaglebone'a uygun şekilde derlemek istiyorum. Sanıyorum ki opencv buna göre make yapılmalı önce. -D CMAKE_TOOLCHAIN_FILE= ? bunu nasıl eldeceğimi anlayamadım. Aklıma gelen diğer seçenek make işlemini Beaglebone'da yapıp ordan geliştirme yapacağım bilgisayara aktarmak ve Beaglebone toolchain'e göre derlemek. QT creator kullanmak istmeiştim fakat toolchainin işaret edileceği yeri göremedim. Bu konu hakkında ne söyleyebilirsiniz?
Iyi calismalar, direk beaglebone uzerinde de derleyebilirsin. Fakat cross development yapmak istiyorsan, benim onerim sanal makina yada docker gibi katmanlari kullanmadir. Bu sekilde isletim sisteminden bagimsiz bir sekilde derlersin. Windowsda direk cross derleyip linux uzerinde calistirmak gereksiz olabilir. Senin yerinde olsam en son paylastigim docker ile cross derleme videosuna bakardim. Ordaki docker dosylarini modifiye eder gerekli sonuca ulasirdim. Qt icin cozumu benim yaptigim icerikten ulasirsin gibi duruyor bir kac deneme ile. beaglebone zaten debian based olmasi lazim cok bir fark yok. Opencv icin ise, ilk basit bir kac opencv ornegini cross olarak derle cmake ile sonra beagleboneda calistigini gor. Ardindan zaten docker yada sanal makina kullanarak qt ile olan adimlari birlestirirsin. CMAKE_TOOLCHAIN_FILE dosyasi toolchain ile alakali katmanlari icermeli sanki, opencv cmakelists.txt de cagirilabilir. Opencv yi qt gibi dusun, sadece so(shared object) dosyalari var ve onlari cmake ile bind etmen lazim. (bide header lar tabi) :)
@@ulasdikme7307 Buna bakacağım, C++ tarafı ikinci uygulamam olacakta , şu anda spyder idesinde pythonda yazdığım logitech kamerasına ulaşan opencv kodu, beaglebone'da çalıştıramıyorum :). Gstreamer hatası alıyorum ayrıca kamera verisi alamdığından timeout oluşuyor ama kameraya ulaşıyor ledin yanmasından anlıyorum. Önce bu tarafı halletmem önemli.
O my god, I have installed whole qt6 on linux machine, together with compiler, and now I am wondering why I was compiled qt-base if I have already. Now what i want was only toolchain for arm processor - raspberry.. :/ because that toolchain will convert code to be used in raspberry :/
It is not in hard way to do it? And how about qt creator, there is also ability to set toolchain and set ssh connection to set automatically compiled apps
Having issues with xkbcommon-x11.h header. fatal error: xkbcommon/xkbcommon-x11.h: No such file or directory when # include is being called under plaforms/xcb/qxcbkeyboard.h:51:10 I've modified the configuration a little bit to force this on: XCB: Using system-provided xcb-xinput ..... yes " by adding -DFEATURE_system_xcb_xinput=ON" to the configuration call. I've tried manually downloading a lot of diff libs to cover my grounds on xcb, but so far nothing is working.
Hello Ulas, Qt 6.3.0 isn't no more available, so I've tried your tuto with Qt6.2.0 and 6.4.0 and It doesn't work. Compilation is OK on my Host, but cross is not OK, I have many Cmake errors.
Hi, yes it is quite old. But the way is correct. You need to change toolchain. github.com/PhysicsX/QTonRaspberryPi/tree/main/QtRaspberryPi6.6.1 in this link there is new version, ( while copying the commands, i could made a mistake, but it is working) so if you check carefully, I compiled the toolchain. If you follow the steps, it will work. Currently I am thinking to create a new content about it but lets see.
Hello, I've tried your new tutorial, but I can't compile toolchain - I'm using a raspi 3 - I've mistake with headers_install (not found command) - Can I still use Linearo Tool chain instead ?@@ulasdikme7307
I shared a new video, with docker you should be able to compile it if you follow the steps, please watch the new one also. Which version of toolchain you use? I tested with rasp 4 there can be differences with rasp 3.
by following these steps on my raspberry pi 3 model b, can I create the GUI with QT design studio and run it on raspberry? I should do a university project on it
Stuck on fontconfig for cross compiling qtwebengine.. brought over etc/fonts and etc/alternatives in sysroot.. still no good. Arm64 .. I think this is the last step any ideas?
This tutorial is quite old, because of toolchain you can see some issues, here it is updated version github.com/PhysicsX/QTonRaspberryPi/tree/main/QtRaspberryPi6.6.1 and also I created a very easy way with docker, I recommend you to check this page also github.com/PhysicsX/QTonRaspberryPi/tree/main/QtRaspberryPiWithDocker6.6.1. I will make a video about it soon.
@@ulasdikme7307 also makes sense to bring over etc/alternatives over with rsync.. I have been weeding though most of the pkg-config pc today.. up to the glib needing pkg and pkg neeeding glib.. anyway I found something strange on bookworm, Pkg-config exists glib returns a 0 on the pi itself .. and that is where it stops on cross compile build.. in the morning I will get out my snow shoes and start walking up that mountain, thanks for you input..
Hi Ulas! Great manual! Thanks! At first I tried to compile for Ubuntu 20.04.4, but I got an error. Then I installed ubuntu 22.04 and everything compiled without errors. And your examples also work correctly. Now I'm trying to connect Qt to Qt Creator, but I can't figure out which qmake to set in its options (in Kits -> Qt Versions). If I set qmake from the qt6Host directory, I get an error: "The compiler "GCC" (arm-linux-generic-elf-32bit) cannot produce code for the Qt version "Qt 6.3.0 (qt6Host)" (x86-linux-generic-elf-64bit)" It is because this qmake is for X86. I think I need to specify qmake from the qt6rpi directory, but it is for ARM. When I try to set it, I get an error: "Qmake Not Executable" Do you know how to set Qmake in Qt Creator?
Thanks. It is the hard part, you should use all steps or tools same as much as possible. At least not the old ones. Yes I will do the video about the qtcreator but it will take some time. To help, you do not need qmake anymore you have cmake. That means you do not need to configure qmake in the qtcreator. We may not need to have qtcreator anymore. Compilation for qt6 is more generic. That is the revolutionary part :S. That means you can use vscode also ! or any other ide which you like.
You did copied so much files for cross platform, but I found a way how connect qt Creator using ssh connection, and creator automatically found remote device and and did find out compiler on that device
hello am getting this error [970/1580] Building CXX object src/gui/CMakeFiles/Gui.dir/itemmodels/qfilesystemmodel.cpp.o ninja: build stopped: subcommand failed. can you assist please
Yes I got a similar one as well, it said it failed on assertion: In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /home/shady/qt-cross/qtbase-everywhere-src-6.3.0/src/gui/platform/unix/qeventdispatcher_glib.cpp:46: /usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’: /usr/include/glib-2.0/glib/gtypes.h:463:47: error: static assertion failed: Expression evaluates to false G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gmacros.h:742:46: note: in definition of macro ‘G_STATIC_ASSERT’ #define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false") ^~~~ [6/555] Building CXX object qmake/CMak...ative.dir/library/qmakeevaluator.cpp.o ninja: build stopped: subcommand failed.
@@KavitaAwasti I recommend to follow the Qt6 Wiki Guide closely. It works, you just have to be careful to make sure you have the correct Toolchain for the system you are cross compiling.
My project build for qt-cross keeps failing. 1:03:20. I don't understand how to fix this, it's so sad. I get this: Make Error in src/corelib/CMakeLists.txt: Imported target "WrapDoubleConversion::WrapDoubleConversion" includes non-existent path "/usr/include/double-conversion" in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include: * The path was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and references files it does not provide. CMake Error in src/corelib/CMakeLists.txt: Imported target "WrapDoubleConversion::WrapDoubleConversion" includes non-existent path "/usr/include/double-conversion" in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include: * The path was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and references files it does not provide. CMake Error at cmake/FindWrapSystemHarfbuzz.cmake:56 (target_link_libraries): The link interface of target "WrapSystemHarfbuzz::WrapSystemHarfbuzz" contains: PkgConfig::PC_HARFBUZZ but the target was not found. Possible reasons include: * There is a typo in the target name. * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing. Call Stack (most recent call first): cmake/QtFindPackageHelpers.cmake:130 (find_package) src/gui/configure.cmake:41 (qt_find_package) cmake/QtFeature.cmake:573 (include) src/CMakeLists.txt:12 (qt_feature_evaluate_features)
Do you use different version of OS? You should update some cmake file. sysroot \ usr \ lib \ aarch64-linux-gnu \ cmake \ double-conversion \ double-conversionConfig There should be .cmake and you should change the line which is related with double conversion set_target_properties(double-conversion::double-conversion PROPERTIES #INTERFACE_INCLUDE_DIRECTORIES "/usr/include/double-conversion" INTERFACE_INCLUDE_DIRECTORIES add your sysroot path"/usr/include/double-conversion" )
@@ulasdikme7307 So yes, I was using the wrong version of Pi OS. I switched now from 64bit to 32bit. But now when I Cmake build parallel, it keeps stopping the build due to assertions failing, for example: In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /home/shady/qt-cross/qtbase-everywhere-src-6.3.0/src/gui/platform/unix/qeventdispatcher_glib.cpp:46: /usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’: /usr/include/glib-2.0/glib/gtypes.h:463:47: error: static assertion failed: Expression evaluates to false G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gmacros.h:742:46: note: in definition of macro ‘G_STATIC_ASSERT’ #define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false") ^~~~ [6/555] Building CXX object qmake/CMak...ative.dir/library/qmakeevaluator.cpp.o ninja: build stopped: subcommand failed. And also the fact that while building with cmake -GNinja it passes but still, double conversion and md4c is missing: -- The CXX compiler identification is GNU 8.3.0 -- The C compiler identification is GNU 8.3.0 -- The ASM compiler identification is GNU -- Found assembler: /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-gcc -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Could NOT find double-conversion (missing: double-conversion_DIR) -- Could NOT find md4c (missing: md4c_DIR)
@@SkeleCrafteronYT It looks 64 and 32 bit is mixed in some point. Maybe you should clean everything and start again. And also if you do not use 2022-04-04-raspios-bullseye-armhf this version for the rasp then it will be good idea to use it. If everything is working then you can switch to another version.
@@ulasdikme7307 I also reinstalled ubuntu but now I'm still stuck on the same step with this error. I don't understand. Also I would like to ask why your guide is different to the one suggested on the QT wiki. Similar steps but with different files and methods. ERROR: The OpenGL functionality tests failed! 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 the mkspec for your platform. CMake Error at cmake/QtBuildInformation.cmake:92 (message): Check the configuration messages for an error that has occurred. Call Stack (most recent call first): cmake/QtBuildInformation.cmake:11 (qt_configure_print_summary) cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:489 (qt_print_feature_summary) CMakeLists.txt:193 (qt_build_repo_end) -- Configuring incomplete, errors occurred! Is this a problem with the toolchain?
@@maxim25o2 Thanks for your comments. If you are able to share your steps clearly or command history then other people can also see them. Maybe I can create another content according to your instructions. :)
Is this what people who develop embedded GUIs professionally do? If so, may Lord be with you, cause you are living hell. It is my like 5th attempt so far to actually cross compile anything. And this one failed as well (can't wget qtbase, don't know why).
Tutorial is quite old, so it needs update. There is an official tutorial on qt website. I recommend you to check it. If I find time, I will update it. btw I like your playlist.
@ulasdikme7307 I was able to download latest qtbase on windows and transfer it to VM, otherwise links didn't respond on VM. Hope I'll get eventually to cross compile "hello world" 🤞. Anyway thanks for explaining the steps in the tutorial, it helps!
@@ulasdikme7307 abone oldum. cevap vereceğini hiç düşünmemiştim :) docker de bilmiyorum ki hiç kullanmadım. şimdi ona da bulaşmayayım bu ara çok şey öğrendim-öğreniyorum kafam çorba oldu. Yani benim gibi ingilizce özürlüleri için lütfen Türkçe de yapın.
Docker lisi daha kolay. Videoyu izle sadece komutlari kos. Tum bagimliliklari ben hallettim sadece komutlari kosarsan bir kac saat sonra qt compile olmus bir sekilde kullanima hazir olarak bulumacak. Github da komutlar var. Docker dedigim sey sanal makina yerine kucuk izolasyon yaratiyor, rasp a falan ihtiyacin yok tum derlemeyi host da yapabiliosun acayip kolaylik. Takildigin yer olursa sor cevaplarim. Github linki video nun altinda. Turkce cok izlenmiyor dedim bari ingilizce yapayim oda cok izlenmedi hos 😁 Ama dusunuyorum zamanim olursa genel bir video yapacagim turkce
Unfortunately, after several days of trying to make this work I always get to about ~1:03:00 part and try to build with cmake --build . --parallel 4 command. It fails because /home/joe/qt-cross/qtbase-everywhere-src-6.3.0/src/network/access/qdecompresshelper.cpp:49:14: fatal error: brotli/decode/h: No such file or directory # include compilation terminated. I cant waste any on time on this - one of about 20 cross compiler formulas I have tried and ALL of them fail.
My Project build fails for cross-compiling for Rpi 4 In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /home/kavita/qt-cross/qtbase-everywhere-src-6.2.4/src/gui/platform/unix/qeventdispatcher_glib.cpp:46: /usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’: /usr/include/glib-2.0/glib/gtypes.h:463:47: error: static assertion failed: Expression evaluates to false G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gmacros.h:742:46: note: in definition of macro ‘G_STATIC_ASSERT’ #define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false") ^~~~ [1014/1599] Building CXX object src/gui/CMakeFiles/Gui.dir/rhi/qrhivulkan.cpp.o ninja: build stopped: subcommand failed. I have cleaned everything and prepared new SD card with Bullseye 32 bit OS and now trying to build QT and again I got stuck with the same error.
I have watched your latest videos about Qt for Raspberry several times and I would like you to record a new video with Qt6. Today is a special day that my wish was granted. Thank you, I'm actually watching the video! I enjoy!
After many hours of surfing the web to find out how to cross compile Qt6 (every tutorial is for Qt5.x) for the RasPi your video saved me!
Please keep these going, especially with the submodules and EGLFS, and if that is possible to run a Qt6 application full screen on the Raspberry Pi 4 without the X11 GUI so directly using the OpenGL module.
Thank you!
for people getting ERROR: The OpenGL functionality tests failed! 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 the mkspec for your platform.
i also had the same problem, you probably forgot to change the set(TARGET_SYSROOT /home/ulas/rpi-sdk/sysroot) in the toolchain.
Delete the qt-cross and repeat the steps again:
$ cd ..
$ mkdir qt-cross
$ cd !$
then when creating the toolchain file make sure to change the set(TARGET_SYSROOT /home/**here your folder**/rpi-sdk/sysroot) and save
$ tar xf ../qtbase-everywhere-src-6.3.0.tar.xz
-change the **here your folder** in the next command
$cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_FEATURE_eglfs_egldevice=ON -DQT_FEATURE_eglfs_gbm=ON \
-DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF \
-DQT_HOST_PATH=/home/**here your folder**/qt6Host -DCMAKE_STAGING_PREFIX=/home/**here your folder**/qt6rpi \
-DCMAKE_INSTALL_PREFIX=/home/**here your folder**/qt6crosspi -DCMAKE_PREFIX_PATH=/home/**here your folder**/rpi-sdk/sysroot/usr/lib/ \
-DCMAKE_TOOLCHAIN_FILE=/home/**here your folder**/qt-cross/toolchain.cmake /home/**here your folder**/qt-cross/qtbase-everywhere-src-6.3.0/
you should get a similar summer to the one shown in the video.
most important is this part it should be similar:
OpenGL:
Desktop OpenGL ....................... yes
OpenGL ES 2.0 ........................ no
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
OpenGL ES 3.2 ........................ no
Vulkan ................................. no
Session Management ..................... yes
this should solve it.
hope it helps
very much thanks @Ulas your video is great! its way better than the official qt installation
Hello, I checked the path multiple times, but the error persists. Can you provide any suggestions?
Just a note on the cross compilation , specifically on the host compilation of Qt - when trying the following command:
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DINPUT_opengl=es2 -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/home/ulas/qt6Host
CMake hit a segmentation fault and could not move on. This was due to building straight from the source which was breaking CMake.
The solution was to remove the source build and reinstall the latest stable releast from apt: sudo apt install cmake
Thanks for info, did you build the cmake with latest source or with the commit which is in the github page ? When I was working on it, cmake ,which was installed from apt, was not working.
unfortunately I get this error, I don’t understand what could have missed:
ERROR: The OpenGL functionality tests failed! 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 the mkspec for your platform.
I think it’s because I have a 64bit image
I have the same bug with the 6.3.1 release, try on 64 and 32 bits of raspbian OS :/
I've got the same error... could not find the reason of the issue... T.T
try this cmd: ./configure -prefix /home/qt-cross/qtbase-everywhere-src-6 -opensource -make libs -xplatform linux-arm-gnueabi-g++ -optimized-qmake -pch -no-opengl -skip qt3d -skip qtcanvas3d -skip qtpurchasing -no-sse2 -no-openssl -no-cups -no-glib -nomake examples -nomake tools -skip qtvirtualkeyboard -skip qtquick3d
I tried exactly the same steps, including using ulas as user when creating the VM so I didn't have to change anything of the code-snippets and got exactly the same error when configuring the qt-cross part with cmake.
Any ideas? no other guide including the official one has worked for me yet.
@Ulas Dikme, any idea about this issue?
Ulaş bey iyi çalışmalar,
Windows veya linux tarafında opencv içeren C++ kodları yazıp, bunu Beaglebone'a uygun şekilde derlemek istiyorum. Sanıyorum ki opencv buna göre make yapılmalı önce. -D CMAKE_TOOLCHAIN_FILE= ? bunu nasıl eldeceğimi anlayamadım. Aklıma gelen diğer seçenek make işlemini Beaglebone'da yapıp ordan geliştirme yapacağım bilgisayara aktarmak ve Beaglebone toolchain'e göre derlemek. QT creator kullanmak istmeiştim fakat toolchainin işaret edileceği yeri göremedim. Bu konu hakkında ne söyleyebilirsiniz?
Iyi calismalar, direk beaglebone uzerinde de derleyebilirsin. Fakat cross development yapmak istiyorsan, benim onerim sanal makina yada docker gibi katmanlari kullanmadir. Bu sekilde isletim sisteminden bagimsiz bir sekilde derlersin. Windowsda direk cross derleyip linux uzerinde calistirmak gereksiz olabilir. Senin yerinde olsam en son paylastigim docker ile cross derleme videosuna bakardim. Ordaki docker dosylarini modifiye eder gerekli sonuca ulasirdim. Qt icin cozumu benim yaptigim icerikten ulasirsin gibi duruyor bir kac deneme ile. beaglebone zaten debian based olmasi lazim cok bir fark yok. Opencv icin ise, ilk basit bir kac opencv ornegini cross olarak derle cmake ile sonra beagleboneda calistigini gor. Ardindan zaten docker yada sanal makina kullanarak qt ile olan adimlari birlestirirsin. CMAKE_TOOLCHAIN_FILE dosyasi toolchain ile alakali katmanlari icermeli sanki, opencv cmakelists.txt de cagirilabilir. Opencv yi qt gibi dusun, sadece so(shared object) dosyalari var ve onlari cmake ile bind etmen lazim. (bide header lar tabi) :)
@@ulasdikme7307 Buna bakacağım, C++ tarafı ikinci uygulamam olacakta , şu anda spyder idesinde pythonda yazdığım logitech kamerasına ulaşan opencv kodu, beaglebone'da çalıştıramıyorum :). Gstreamer hatası alıyorum ayrıca kamera verisi alamdığından timeout oluşuyor ama kameraya ulaşıyor ledin yanmasından anlıyorum. Önce bu tarafı halletmem önemli.
O my god, I have installed whole qt6 on linux machine, together with compiler, and now I am wondering why I was compiled qt-base if I have already. Now what i want was only toolchain for arm processor - raspberry.. :/ because that toolchain will convert code to be used in raspberry :/
Thank you so much for this video.
It is not in hard way to do it? And how about qt creator, there is also ability to set toolchain and set ssh connection to set automatically compiled apps
Great tutorial. Any idea how can this be ported to pi zero 2 W?
Having issues with xkbcommon-x11.h header.
fatal error: xkbcommon/xkbcommon-x11.h: No such file or directory when # include is being called under plaforms/xcb/qxcbkeyboard.h:51:10 I've modified the configuration a little bit to force this on:
XCB:
Using system-provided xcb-xinput ..... yes " by adding -DFEATURE_system_xcb_xinput=ON" to the configuration call. I've tried manually downloading a lot of diff libs to cover my grounds on xcb, but so far nothing is working.
Hello Ulas, Qt 6.3.0 isn't no more available, so I've tried your tuto with Qt6.2.0 and 6.4.0 and It doesn't work. Compilation is OK on my Host, but cross is not OK, I have many Cmake errors.
Hi, yes it is quite old. But the way is correct. You need to change toolchain. github.com/PhysicsX/QTonRaspberryPi/tree/main/QtRaspberryPi6.6.1 in this link there is new version, ( while copying the commands, i could made a mistake, but it is working) so if you check carefully, I compiled the toolchain. If you follow the steps, it will work. Currently I am thinking to create a new content about it but lets see.
Thanks, I will try your suggestion, I've already spent 3 days of working for the moment...@@ulasdikme7307
Hello, I've tried your new tutorial, but I can't compile toolchain - I'm using a raspi 3 - I've mistake with headers_install (not found command) - Can I still use Linearo Tool chain instead ?@@ulasdikme7307
I shared a new video, with docker you should be able to compile it if you follow the steps, please watch the new one also. Which version of toolchain you use? I tested with rasp 4 there can be differences with rasp 3.
Thanks, I'm going to try your new tutorial .I used rpi-gcc-8.3.0 @@ulasdikme7307
by following these steps on my raspberry pi 3 model b, can I create the GUI with QT design studio and run it on raspberry? I should do a university project on it
Ulaş kardeşim eline emeğine sağlık başarılar
Stuck on fontconfig for cross compiling qtwebengine.. brought over etc/fonts and etc/alternatives in sysroot.. still no good. Arm64 .. I think this is the last step any ideas?
This tutorial is quite old, because of toolchain you can see some issues, here it is updated version github.com/PhysicsX/QTonRaspberryPi/tree/main/QtRaspberryPi6.6.1 and also I created a very easy way with docker, I recommend you to check this page also github.com/PhysicsX/QTonRaspberryPi/tree/main/QtRaspberryPiWithDocker6.6.1. I will make a video about it soon.
@@ulasdikme7307 also makes sense to bring over etc/alternatives over with rsync.. I have been weeding though most of the pkg-config pc today.. up to the glib needing pkg and pkg neeeding glib.. anyway I found something strange on bookworm, Pkg-config exists glib returns a 0 on the pi itself .. and that is where it stops on cross compile build.. in the morning I will get out my snow shoes and start walking up that mountain, thanks for you input..
Hi Ulas!
Great manual!
Thanks!
At first I tried to compile for Ubuntu 20.04.4, but I got an error.
Then I installed ubuntu 22.04 and everything compiled without errors. And your examples also work correctly.
Now I'm trying to connect Qt to Qt Creator, but I can't figure out which qmake to set in its options (in Kits -> Qt Versions).
If I set qmake from the qt6Host directory, I get an error: "The compiler "GCC" (arm-linux-generic-elf-32bit) cannot produce code for the Qt version
"Qt 6.3.0 (qt6Host)" (x86-linux-generic-elf-64bit)" It is because this qmake is for X86.
I think I need to specify qmake from the qt6rpi directory, but it is for ARM. When I try to set it, I get an error: "Qmake Not Executable"
Do you know how to set Qmake in Qt Creator?
Thanks.
It is the hard part, you should use all steps or tools same as much as possible. At least not the old ones.
Yes I will do the video about the qtcreator but it will take some time. To help, you do not need qmake anymore you have cmake. That means you do not need to configure qmake in the qtcreator.
We may not need to have qtcreator anymore. Compilation for qt6 is more generic. That is the revolutionary part :S. That means you can use vscode also ! or any other ide which you like.
Thanks! where I can find the source code for the repos for rpi-toolchain?
Can you make a video for beaglebone black? I really need it. Thanks for the great tutorial.
Great tutorial! Many thanks!
You did copied so much files for cross platform, but I found a way how connect qt Creator using ssh connection, and creator automatically found remote device and and did find out compiler on that device
And Qt6 is ready to use download app with gcc compiler in side. :/, and all of that was not necessary. And ubuntu is supporting qt creator.
hello am getting this error [970/1580] Building CXX object src/gui/CMakeFiles/Gui.dir/itemmodels/qfilesystemmodel.cpp.o
ninja: build stopped: subcommand failed.
can you assist please
Yes I got a similar one as well, it said it failed on assertion:
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from /home/shady/qt-cross/qtbase-everywhere-src-6.3.0/src/gui/platform/unix/qeventdispatcher_glib.cpp:46:
/usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’:
/usr/include/glib-2.0/glib/gtypes.h:463:47: error: static assertion failed: Expression evaluates to false
G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:742:46: note: in definition of macro ‘G_STATIC_ASSERT’
#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
^~~~
[6/555] Building CXX object qmake/CMak...ative.dir/library/qmakeevaluator.cpp.o
ninja: build stopped: subcommand failed.
@@SkeleCrafteronYT I am also getting the same error even I had seen replies on your comment so prepared new SD card still getting same error.
@@KavitaAwasti I recommend to follow the Qt6 Wiki Guide closely. It works, you just have to be careful to make sure you have the correct Toolchain for the system you are cross compiling.
My project build for qt-cross keeps failing. 1:03:20. I don't understand how to fix this, it's so sad. I get this:
Make Error in src/corelib/CMakeLists.txt:
Imported target "WrapDoubleConversion::WrapDoubleConversion" includes
non-existent path
"/usr/include/double-conversion"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Error in src/corelib/CMakeLists.txt:
Imported target "WrapDoubleConversion::WrapDoubleConversion" includes
non-existent path
"/usr/include/double-conversion"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
CMake Error at cmake/FindWrapSystemHarfbuzz.cmake:56 (target_link_libraries):
The link interface of target "WrapSystemHarfbuzz::WrapSystemHarfbuzz"
contains:
PkgConfig::PC_HARFBUZZ
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
cmake/QtFindPackageHelpers.cmake:130 (find_package)
src/gui/configure.cmake:41 (qt_find_package)
cmake/QtFeature.cmake:573 (include)
src/CMakeLists.txt:12 (qt_feature_evaluate_features)
Do you use different version of OS? You should update some cmake file. sysroot \ usr \ lib \ aarch64-linux-gnu \ cmake \ double-conversion \ double-conversionConfig There should be .cmake and you should change the line which is related with double conversion set_target_properties(double-conversion::double-conversion PROPERTIES
#INTERFACE_INCLUDE_DIRECTORIES "/usr/include/double-conversion"
INTERFACE_INCLUDE_DIRECTORIES add your sysroot path"/usr/include/double-conversion"
)
@@ulasdikme7307 So yes, I was using the wrong version of Pi OS. I switched now from 64bit to 32bit. But now when I Cmake build parallel, it keeps stopping the build due to assertions failing, for example:
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from /home/shady/qt-cross/qtbase-everywhere-src-6.3.0/src/gui/platform/unix/qeventdispatcher_glib.cpp:46:
/usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’:
/usr/include/glib-2.0/glib/gtypes.h:463:47: error: static assertion failed: Expression evaluates to false
G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:742:46: note: in definition of macro ‘G_STATIC_ASSERT’
#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
^~~~
[6/555] Building CXX object qmake/CMak...ative.dir/library/qmakeevaluator.cpp.o
ninja: build stopped: subcommand failed.
And also the fact that while building with cmake -GNinja it passes but still, double conversion and md4c is missing:
-- The CXX compiler identification is GNU 8.3.0
-- The C compiler identification is GNU 8.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-gcc
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find double-conversion (missing: double-conversion_DIR)
-- Could NOT find md4c (missing: md4c_DIR)
@@SkeleCrafteronYT It looks 64 and 32 bit is mixed in some point. Maybe you should clean everything and start again. And also if you do not use 2022-04-04-raspios-bullseye-armhf this version for the rasp then it will be good idea to use it. If everything is working then you can switch to another version.
@@ulasdikme7307 I also reinstalled ubuntu but now I'm still stuck on the same step with this error. I don't understand. Also I would like to ask why your guide is different to the one suggested on the QT wiki. Similar steps but with different files and methods.
ERROR: The OpenGL functionality tests failed! 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 the mkspec for your platform.
CMake Error at cmake/QtBuildInformation.cmake:92 (message):
Check the configuration messages for an error that has occurred.
Call Stack (most recent call first):
cmake/QtBuildInformation.cmake:11 (qt_configure_print_summary)
cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:489 (qt_print_feature_summary)
CMakeLists.txt:193 (qt_build_repo_end)
-- Configuring incomplete, errors occurred!
Is this a problem with the toolchain?
@@SkeleCrafteronYT Which Qt wiki ? As I see it is asking now opengl path. Maybe opengl is not installed in the target ?
This is output of the test of conection from QT Ctreator
Sending echo to device...
Device replied to echo with expected contents.
Checking kernel version...
Linux 5.15.73-v8+ aarch64
Checking if specified ports are available...
All specified ports are available.
Checking whether "sftp" works...
"sftp" is functional.
Checking whether "rsync" works...
"rsync" is functional.
Checking if required commands are available...
base64...
base64 found.
cat...
cat found.
chmod...
chmod found.
cp...
cp found.
cut...
cut found.
dd...
dd found.
df...
df found.
echo...
echo found.
eval...
eval found.
exit...
exit found.
kill...
kill found.
ls...
ls found.
mkdir...
mkdir found.
mkfifo...
mkfifo found.
mktemp...
mktemp found.
mv...
mv found.
printf...
printf found.
read...
read found.
readlink...
readlink found.
rm...
rm found.
sed...
sed found.
sh...
sh found.
shift...
shift found.
stat...
stat found.
tail...
tail found.
test...
test found.
trap...
trap found.
touch...
touch found.
which...
which found.
Device test finished successfully.
I can also see running processes on host from raspberry..
@@maxim25o2 Thanks for your comments. If you are able to share your steps clearly or command history then other people can also see them. Maybe I can create another content according to your instructions. :)
Hello, greate tuotrial, But after all i reach Illegal instruction error, Do you know what it can be ?
XCB not configured, cannot run apps, please help me
have you prepared your toolchain using crosstool-ng?
Will these steps work for Qt 6.5?
can I do same process for Qt5.15
Thanks for your great vidieo but how we can do it by raspberry pi 3?
@Ulas it's possible to do it?
See my comment above.
Great tutorial, would there be a cross-compilation tutorial on Qt6 for Jetson Nano? That would be awesome!
thanks i got it working but anyone knows how to set it up inside qt creator
I need some help here i got a black screen after rpi-update.
Great tutorial we appreciate your work sir.
Thanks for this. Got it working but the picture won't show in the app. Will you do a vid with Qt creator integration?
Yes I will but it will take some time because I need to explain for modules and other things first about qt6 (Cmake and platform)
The image not showing is because it isn't present in you Rpi (most probably).
@@AthemSaurav I moved it over with the app and can see it in the pi in the dir path. Might just be the picture I used? I stole it off the net.
@@vj4 same as me 🙂
same here
if you read my comment .please repeat to me becouse i need helpe about thise raspberry qt
Is this what people who develop embedded GUIs professionally do? If so, may Lord be with you, cause you are living hell. It is my like 5th attempt so far to actually cross compile anything. And this one failed as well (can't wget qtbase, don't know why).
Tutorial is quite old, so it needs update. There is an official tutorial on qt website. I recommend you to check it. If I find time, I will update it. btw I like your playlist.
@ulasdikme7307 I was able to download latest qtbase on windows and transfer it to VM, otherwise links didn't respond on VM. Hope I'll get eventually to cross compile "hello world" 🤞.
Anyway thanks for explaining the steps in the tutorial, it helps!
sakın türkçe yapma.
hahahah 😁 Turkce de yaparim siz abone olun. Sorun yok.
Bu arada yeni docker ile bir tutorial yaptim onu ornek alirsan daha iyi olur bu eski.
@@ulasdikme7307 abone oldum. cevap vereceğini hiç düşünmemiştim :) docker de bilmiyorum ki hiç kullanmadım. şimdi ona da bulaşmayayım bu ara çok şey öğrendim-öğreniyorum kafam çorba oldu. Yani benim gibi ingilizce özürlüleri için lütfen Türkçe de yapın.
Docker lisi daha kolay. Videoyu izle sadece komutlari kos. Tum bagimliliklari ben hallettim sadece komutlari kosarsan bir kac saat sonra qt compile olmus bir sekilde kullanima hazir olarak bulumacak. Github da komutlar var. Docker dedigim sey sanal makina yerine kucuk izolasyon yaratiyor, rasp a falan ihtiyacin yok tum derlemeyi host da yapabiliosun acayip kolaylik. Takildigin yer olursa sor cevaplarim. Github linki video nun altinda.
Turkce cok izlenmiyor dedim bari ingilizce yapayim oda cok izlenmedi hos 😁 Ama dusunuyorum zamanim olursa genel bir video yapacagim turkce
Unfortunately, after several days of trying to make this work I always get to about ~1:03:00 part and try to build with cmake --build . --parallel 4 command. It fails because
/home/joe/qt-cross/qtbase-everywhere-src-6.3.0/src/network/access/qdecompresshelper.cpp:49:14: fatal error: brotli/decode/h: No such file or directory
# include
compilation terminated.
I cant waste any on time on this - one of about 20 cross compiler formulas I have tried and ALL of them fail.
Hey Ulas! I've sent you a message on LinkedIn. I'm stuck at 1:03:18. Need your assistance to pull through 🙂.
My Project build fails for cross-compiling for Rpi 4
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from /home/kavita/qt-cross/qtbase-everywhere-src-6.2.4/src/gui/platform/unix/qeventdispatcher_glib.cpp:46:
/usr/include/glib-2.0/glib/gtypes.h: In function ‘gboolean _GLIB_CHECKED_ADD_U64(guint64*, guint64, guint64)’:
/usr/include/glib-2.0/glib/gtypes.h:463:47: error: static assertion failed: Expression evaluates to false
G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:742:46: note: in definition of macro ‘G_STATIC_ASSERT’
#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
^~~~
[1014/1599] Building CXX object src/gui/CMakeFiles/Gui.dir/rhi/qrhivulkan.cpp.o
ninja: build stopped: subcommand failed.
I have cleaned everything and prepared new SD card with Bullseye 32 bit OS and now trying to build QT and again I got stuck with the same error.