Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. cross compile
    Log in to post

    • UNSOLVED cross-compile application with Qt which also uses OpenCV C++ on raspberry pi
      Mobile and Embedded • cross compile qt5.9 raspberry pi 4 opencv cpp opencv qtcreato • • ishi  

      4
      0
      Votes
      4
      Posts
      40
      Views

      @ishi Visual Studio is of no interest here as you cannot use it to cross compile to ARM Linux as far as I know. If your app is using OpenCV you will either need to install it on your RPi (including the -dev package) and sync the sysroot, or cross-compile it.
    • UNSOLVED CMAKE_PREFIX_PATH is not working with Android
      Installation and Deployment • android cmake cross compile • • noone  

      1
      0
      Votes
      1
      Posts
      110
      Views

      No one has replied

    • SOLVED QMYSQL driver not loaded - cross compiling for Raspberry PI 3
      Installation and Deployment • cross compile raspberry pi 3 qmysql • • JarekT  

      26
      0
      Votes
      26
      Posts
      375
      Views

      Finally (!...) I was able to fix the problems. I'm showing the whole procedure, not only what relates to the main subject of this thread so that to contribute to the community.. I was using the following sites as a source information to work out the following solution: LINK1 (for other Qt/Raspberry PI configuration check: link), LINK2, LINK3, LINK4, LINK5, LINK6. My hardware/software: Host: Ubuntu 18.04 (also I’ve check it on Ubuntu 20.04 and it also works) Qt ver. 5.12.3 (I also tried 5.12.9, but it didn’t work, probably there was something wrong with the fix that needs to be done on the sources) - you can install the “sources” and all the modules you need from Qt Online Installer (link) because later on you can add/remove modules/versions easily by lauching ~/Qt/MaintenanceTool QtCreator will be installed automatically (the newest version) when you use Qt Online Installer Target: Raspberry PI 3, with Raspbian Stretch Procedure: [on RPi] Edit sources list in /etc/apt/sources.list and uncomment the deb-src line: sudo nano /etc/apt/sources.list [on RPi] Update your system and install required libraries: sudo apt-get update sudo apt-get build-dep qt4-x11 sudo apt-get build-dep libqt5gui5 sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 After installing MySQL itself on RPi install also MySQL libraries/packages to be used by Qt: sudo apt install mariadb-client libmariadb-dev-compat libqt5sql5-mysql [on RPi] Prepare our target directory sudo mkdir /usr/local/qt5pi sudo chown pi:pi /usr/local/qt5pi [on RPi] Correct links to EGL and GLES Drivers sudo rm /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sudo rm /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 sudo ln -s /opt/vc/lib/libbrcmEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sudo ln -s /opt/vc/lib/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 [on host] Create our working directory and get a toolchain: mkdir ~/raspi cd ~/raspi git clone https://github.com/raspberrypi/tools [on host] Create a sysroot. mkdir sysroot sysroot/usr sysroot/opt rsync -avz pi@yourpi:/lib sysroot rsync -avz pi@yourpi:/usr/include sysroot/usr rsync -avz pi@yourpi:/usr/lib sysroot/usr rsync -avz pi@yourpi:/opt/vc sysroot/opt [on host] Adjust symlinks to be relative: wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py chmod +x sysroot-relativelinks.py ./sysroot-relativelinks.py sysroot [on host] Modify the qmake.conf –> mkspecs/devices/linux-rasp-pi3-g++/qmake.conf nano ~/raspi/qtbase/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf VC_LIBRARY_PATH = $$[QT_SYSROOT]/opt/vc/lib VC_INCLUDE_PATH = $$[QT_SYSROOT]/opt/vc/include VC_LINK_LINE = -L$${VC_LIBRARY_PATH} QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH} QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2 QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2 [on host] Protect your “sources” by creating working folder: cd ~/Qt/5.12.3 tar jcvf qt-5.12.3-src.tar.bz2 Src cd ~/raspi tar xvf ~/Qt/5.12.3/qt-5.12.3-src.tar.bz2 mv Src qt-5.12.3-src You can remove from qt-5.12.3-src the modules that you don’t want (at least for now) leaving qtbase folder - this will shorten the building process. Create also working folder for the building (if building would be unsuccessful all you need to do is to delete the content of this folder and start again): mkdir ~/raspi/build_raspi cd ~/raspi/build_raspi [on host] Configure From ~/raspi/build_raspi ../qt-5.12.3-src/configure -release -opengl es2 -device linux-rasp-pi3-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 -no-gbm -sql-mysql MYSQL_INCDIR=~/raspi/sysroot/usr/include/mysql MYSQL_LIBDIR=~/raspi/sysroot/usr/lib/arm-linux-gnueabihf Notice the above contains also building MySQL driver. Notice that the Config summary should contain (if it doesn't, you need to correct something... and do the configure again): EGLFS Raspberry Pi ................... yes MySql .................................. yes Regarding “-release” parameter read here (in other words you don’t need “-debug-and-release” and the warnings you can ignore… at least this is what I can read at the forum). [on host] Make From ~/raspi/build_raspi make You can use make -j 8 instead (much faster), but if there will be problems the all the “jobs” would need to finish and consequently it could be more difficult to find the error messages. [on host] Make install From ~/raspi/build_raspi: make install [on host] Deploy Qt to the device. We simply sync everything from ~/raspi/qt5pi to the prefix we configured above From ~/raspi: rsync -avz qt5pi pi@192.168.1.100:/usr/local [on host] Configuration of QtCreator: Tools > Options > Devices > Add > Generic Linux Device > Start Wizard Write: “Raspberry” (your custom name), “192.168.X.X” (your Raspberry PI address), “pi” (your Raspberry PI user) Don’t write anything at “private key”, click “Next” There will be error window with: “Device test failed” > Cancel Authentication type → choose: “Default” Now test connection (“Test” button) and after you give the password to the RPi it should be successful Kits > Compilers > Add > GCC > C Write: “GCC (Raspberry Pi)” as your custom name and: “~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc” as the path to the compiler Kits > Compilers > Add > GCC > C++ Write: “G++ (Raspberry Pi)” as your custom name and: “~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++” as your path to the compiler Regarding the debugger, you should install: [On Host]: sudo apt-get install gdb-multiarch I’m not sure if this is needed but you can also install on RPi: sudo apt-get install gdbserver Kits > Debuggers > Add Write: “GDB (Raspberry Pi)” as your custom name and “/usr/bin/gdb-multiarch” as the path to the debugger Apply Kits > Qt Version > Add Write path: ~/raspi/qt5/bin/qmake Write name: Qt %{Qt:Version} (qt5) Raspberry PI Apply Kits > Kits > Add Name: Raspi Device Type: Generic Linux Device The Device is the one created in the previous step We set the Sysroot to where we have the sysroot image: ~/raspi/sysroot Set compilers: "GCC (Raspberry PI)" and "G++ (Raspberry PI)" Set the Debugger to the one created previously Use the Qt version we created previously We don't need to set mkspec, so leave it empty. OK To enable your running application to have regular window do the following: Projects > Raspberry PI > Run > Environment > Batch Edit: DISPLAY=:0.0 QT_QPA_PLATFORMTHEME=qt5ct XAUTHORITY=/home/pi/.Xauthority XDG_SESSION_TYPE=x11 If you don’t do this your application after starting up will be shown full screen but you will see it only when directly connect a screen to Raspberry PI (VNC desktop sharing will show nothing) 14) [on host] In your Raspberry PI project, in .pro file, you need to show where the executable file should be placed: (LINK): target.path = /home/pi INSTALLS += target So comment the previous settings, eg.: # qnx: target.path = /tmp/$${TARGET}/bin # else: unix:!android: target.path = /opt/$${TARGET}/bin # !isEmpty(target.path): INSTALLS += target [on host] If you get: “WARNING: The code model could not parse a included file, which might lead to incorrect code completion and highlighting”: You need to deselect “ClangCodeModel” in HELP > ABOUT PLUGINS and restart QtCreator (LINK). You should be able to build/run/debug your project on RPi and connect to the MySQL database without "QMYSQL driver not loaded" error. If the above was useful for you please upvote this solution so that other people could find it easier.
    • SOLVED application can't be displayed on embedded platform
      Mobile and Embedded • qml opengl cross compile embedded qt quick 2d ren • • Kechieh_wang  

      8
      0
      Votes
      8
      Posts
      116
      Views

      @sierdzio Ok, i see, I'm using open source. Maybe I need to change a deviece or try to use qwidget. Thanks for your patience.
    • UNSOLVED Deploy to remote and run in terminal (as root!)?
      General and Desktop • cross compile raspberry pi deploy root term • • pauledd  

      2
      0
      Votes
      2
      Posts
      254
      Views

      I somehow workaround it. On the RaspberryPi I created a bash script in /usr/bin: /usr/bin/x5 #!/bin/bash xhost +local: sudo /home/pi/adas0002 --platform xcb I made it executable and then on my Desktop-Pc in Qt-Creator I have "/usr/bin/x5" in "Alternate executable on device". Now my application starts with root even without invoking any terminal. I know this is very bad in security point of view but I dont care on my little offline Raspi...
    • UNSOLVED Compile for linux target from windows.
      General and Desktop • linux cross compile gcc • • Lior  

      2
      0
      Votes
      2
      Posts
      135
      Views

      @Lior Hi and welcome to devnet forum Do you have a cross-compiler for cross-compilation on windows for linux? There are certainly cross-compilers available. You would have to cross-compile Qt libs with that cross-compiler. After this you can use the cross-compile toolchain and do a cross-compilation for your applications. My personal recommendation is to use virtual machine e.g. VirtualBox and setup the linux environment. Use Qt creator on linux and on windows. You will have the same look and feel in both environments. That is how I do my developments. All is done on windows. However, targeting linux desktop and embedded linux I do the compilation on linux desktop. The reason is lesser pain.
    • UNSOLVED Installing new module
      Mobile and Embedded • cross compile raspberry pi 3 serial port ubuntu 16.04 new module • • vishbynature  

      26
      0
      Votes
      26
      Posts
      657
      Views

      @vishbynature It's config.log file located in the same directory from which you called configure. It is a text file, nothing special. Look for compile errors in that file related to to what you need.
    • UNSOLVED Wi-Fi Manager on RaspberryPi Qt
      Mobile and Embedded • cross compile raspberry pi 3 ubuntu 16.04 wifi connection qtwifimanger • • Andrex_Qt  

      5
      0
      Votes
      5
      Posts
      340
      Views

      @Pablo-J-Rogina I will look into it.
    • UNSOLVED Qt configure could not find MySQL installation when cross compiling for raspi3?
      Mobile and Embedded • qt5 mysql cross compile raspberry pi 3 qmysql • • IMAN4K  

      6
      0
      Votes
      6
      Posts
      388
      Views

      Seems to be a bug reported here QTBUG-50244 Nobody tried to integrate MySQL for a Raspberry Pi project already ?! no workaround?! Seems strange :(
    • SOLVED Qt Creator builds and start running my cross compiled app (raspberry), but the app never shows up
      Mobile and Embedded • cross compile ubuntu raspberry pi 3 qt5.12.x remote debuggin • • alizadeh91  

      7
      0
      Votes
      7
      Posts
      326
      Views

      @sneubert Thanks :)
    • UNSOLVED QT5.12.x Raspberry Pi Zero Cross Compilation QCoreApplication Error
      Tools • qt5 cross compile raspberry pi qcoreapplicatio • • andyDT  

      5
      0
      Votes
      5
      Posts
      1799
      Views

      Hi, Absolutely, in the same creator session I can toggle between toolchains, Desktop is fine, but Raspberry Pi is giving the aforementioned problem. This is my setup. Build settings: PATH: /home/ubuntuvm/raspi/qt5/bin:/home/ubuntuvm/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin Kit: Device: Qt Versions: Compilers: Compiler Path (C & C++): /home/ubuntuvm/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/gcc Debuggers: Qbs:
    • UNSOLVED Cross compilation and Qt configuration issue with Xlib
      General and Desktop • cross compile • • X-Krys  

      4
      0
      Votes
      4
      Posts
      741
      Views

      The thing is, it seems to be looking at the libm.so.6 of your machine and not the one from the sysroot.
    • UNSOLVED Develop on Windows, deploy to Linux?
      Installation and Deployment • linux cross compile deploy cppwebframework • • PaulR  

      5
      0
      Votes
      5
      Posts
      688
      Views

      @SGaist Ahh, okay I see it. Clone Build Config -> Delete Build Steps -> add Custom Process Step Thanks for the inspiration!
    • UNSOLVED Cross-compile and deploy from linux to windows
      Installation and Deployment • linux cross compile windows 10 deploying compiling • • Tranquil  

      10
      0
      Votes
      10
      Posts
      10919
      Views

      @Tranquil I don't know how you read your text-file. But if it is for example with QTextStream, you coulc read line by line, call QString QString::simplified() const on it. that removes all leading and trailing whitespaces and reduces al other whitespaces to a simple single space. That should include tab and multiple spaces. Than QString::splitRef(QChar::Space); on it and you have a vector of all your entries (in StringRef format) -> convert it to your container.
    • UNSOLVED Qt on MarsBoard, Cross compile error, Socket can fd
      Mobile and Embedded • cross compile qt 5.8 serialbus socketcan socket can fd • • Saman19  

      3
      0
      Votes
      3
      Posts
      723
      Views

      @Saman19 said in Qt on MarsBoard, Cross compile error, Socket can fd: Note: QtSerialBus: Newer kernel needed for flexible data-rate frame support (canfd_frame). It does not seem to me a problem but an informative note. If you do not use CAN, check: Is Kernel Network CAN enabled? Something like: Networking support ---> <M> CAN bus subsystem support ---> --- CAN bus subsystem support <M> Raw CAN Protocol (raw access with CAN-ID filtering) <M> Broadcast Manager CAN Protocol (with content filtering) CAN Device Drivers ---> <M> Virtual Local CAN Interface (vcan) <M> Platform CAN drivers with Netlink support Mandatory, because under the kernel is the SocketCAN that handles this. Install the can-utils package It is necessary to include / install QtSerialPort, not for CAN but for ModBus that is part of QtSerialBus. Cleiton Bueno Blog | Linkedin | B2Open
    • SOLVED Qt5 cross-compilation to raspberry pi3 - sh: tools/...../arm-linux-gnueabihf-g++: not found
      Installation and Deployment • cross compile configure raspberry pi 3 • • Worly  

      6
      0
      Votes
      6
      Posts
      1627
      Views

      I have found a solution here. Looks like Ubuntu couldn't run 32bit binary, but it's working now.
    • UNSOLVED Cross-compile Qt 5.9.1 with MSVC 2017 x64 to x86 fails with linker error
      Installation and Deployment • cross compile x86 x64 5.9.1 • • v5exp4  

      13
      0
      Votes
      13
      Posts
      6353
      Views

      I have checked the source code of the qmakeevaluator and the changes are present in version 5.9.1, still it does not recognize the platform. Even if I try to hardcode to the qmake evaluator the following: vars[ProKey("QMAKE_TARGET.arch")] = ProString("x86"); It does not change a thing, still tries to link qmake to x64.
    • UNSOLVED QT cross compilation for S5P4418 (Nanopi M2)
      Installation and Deployment • cross compile eglfs gpu acceletator nanopi m2 • • sap1359  

      2
      0
      Votes
      2
      Posts
      1525
      Views

      Hi ! I have the same problem. The QT included in the last IMG doesn't include a Qmake file. So when I compile like you, it give the same error cause we need to interface with the supplied proprietary libs in /opt I think. On the Raspberry Pi, we need to interface with the VC libs in opt/ to correctly initialise with hardware acceleration, but VC libs are only for the Broadcom chipset on the Pi. On my NanoPI, it is a S5P4418, with a Nexell backend. Maybe we have to do the same with the Nexell libs included on the IMG ? I have a Fire2A and a S2, not sure you have the same configuration as me. Qt recognize EGL and OpenGLES 2 but can't seem to open a display without these libs.
    • SOLVED Unable to cross-compile using Qtcreator
      Mobile and Embedded • qtcreator cross compile • • Sumit  

      12
      0
      Votes
      12
      Posts
      3074
      Views

      @Sumit Should be possible, but I never used Bitbake
    • UNSOLVED Cross compiling and deploying Valgrind
      Installation and Deployment • cross compile arm deploy valgrind • • mtangy  

      4
      0
      Votes
      4
      Posts
      2211
      Views

      I haven't played with that system recently but AFAIR, you should be able to build the sysroot for your system on your desktop machine. Then you could use scp to copy the bits you need over to your device. Doesn't your system provide a possibility to start from another device like a SD card or even a nfs ?
    • UNSOLVED Cross Compile fails while building tools (moc)
      Installation and Deployment • cross compile moc includepath tools • • dogisfat  

      2
      0
      Votes
      2
      Posts
      749
      Views

      I was able to fix the problem by adding this to the qmake.conf file for the device: QMAKE_INCDIR_QT += $$[QT_INSTALL_HEADERS]
    • UNSOLVED QT enable cross-compiling using MinGW (precompiled)
      General and Desktop • qtcreator cross compile mingw cross platform compilers • • CybeX  

      6
      0
      Votes
      6
      Posts
      3687
      Views

      I can only second what @ambershark says. Using a virtual machine is far less pain than what you are trying.
    • SOLVED What is level support to cross compile?
      Mobile and Embedded • qt creator cross compile yocto sdk • • rickY79  

      2
      0
      Votes
      2
      Posts
      774
      Views

      @rickY79 Any of those versions should work if you have the tool chain
    • UNSOLVED Libraries for Desktop and Android
      Mobile and Embedded • android cross compile desktop cross platform gamekit • • Ferni  

      1
      0
      Votes
      1
      Posts
      511
      Views

      No one has replied

    • SOLVED Qt Cross Compile - some binaries are not cross compiled
      General and Desktop • qmake cross compile armhf cubieboard • • MartinCZ  

      3
      0
      Votes
      3
      Posts
      1816
      Views

      @micland Yes, you are right. I was somehow lost. I needed to have qmake compiled for x86_64, but what confused me was that this binary was mixed together with other (ARM) binaries. Just to know. After config stage, it is possible to change CC variable in Makefile and get cross compiled qmake in a few minutes. Thank you and Regards !
    • SOLVED Qt5.7 or 5.7.0?
      Installation and Deployment • cross compile bluetooth qt5.7 git • • Mark81  

      5
      0
      Votes
      5
      Posts
      2262
      Views

      Hi, It depends, the 5.7 branch will contain the current work for the next 5.7 release so if you need something that's not in 5.7.0 you should follow 5.7. Otherwise 5.7.0. Note that 5.7.0 is almost out.
    • UNSOLVED Which toolchain to cross-compile for RPi3
      Installation and Deployment • linux cross compile rpi toolchain • • Mark81  

      3
      0
      Votes
      3
      Posts
      1129
      Views

      @olejl77 this is the article I'm actually following! But the gcc-linaro-arm-linux-gnueabihf-raspbian doens't support ICU: https://github.com/raspberrypi/tools/issues/41 and I don't understand which compiler the Qt5 stuff had in mind when wrote the linux-rpi3-g++ mkspec file because the architecture and the compiler flags are not supported!
    • UNSOLVED Enable ICU support
      Installation and Deployment • cross compile configure icu • • Mark81  

      4
      0
      Votes
      4
      Posts
      2323
      Views

      @Mark81 it's a compiler issue: https://github.com/raspberrypi/tools/issues/41
    • SOLVED rpi3 device missing
      Installation and Deployment • cross compile qt5.6 raspberry pi • • Mark81  

      10
      0
      Votes
      10
      Posts
      7037
      Views

      Here is the catch you have to use arm-linux-gnueabihf-'' instead of arm-linux-gnueabihf. @SGaist thanks for your help
    • UNSOLVED Building Qt apps in Eclipse
      Installation and Deployment • cross compile moc qmake makefile eclipse cdt • • matone1  

      1
      0
      Votes
      1
      Posts
      895
      Views

      No one has replied

    • UNSOLVED How to use configure script to build Qt5 and qmake for remote development on Jetson-TK1
      Mobile and Embedded • qmake cross compile configure remote jetson-tk1 • • IsidoreLechamalin  

      6
      0
      Votes
      6
      Posts
      2847
      Views

      Just saw something, why are you using sudo ? That's not a good idea when you are building anything.
    • UNSOLVED Cross compile Qt 5.5 on Windows 7 error missing <X11/Xutil.h.
      QtonPi • cross compile qt5.5.1 raspberry pi 2 qt 5.6.0 windows 7 64 bi • • Skalli84  

      1
      0
      Votes
      1
      Posts
      914
      Views

      No one has replied

    • UNSOLVED How can I make a Raspberry Pi application running on EGLFS invisible/minimized?
      Mobile and Embedded • cross compile raspberry pi arm eglfs platform • • MikePi-Top  

      1
      1
      Votes
      1
      Posts
      557
      Views

      No one has replied

    • UNSOLVED how to install Qt embedded with phonon ?
      Installation and Deployment • cross compile embedded linux arm qt4.8.7 phonon • • Narthan  

      2
      0
      Votes
      2
      Posts
      1480
      Views

      Hi, Isn't that the same question as you asked here ?
    • SOLVED Unable to link Qt application statically
      Mobile and Embedded • qt5.5 cross compile arm plugins static linking • • zappy  

      6
      0
      Votes
      6
      Posts
      4370
      Views

      @zappy Hello. Have you looked at the bug report in the other thread you were following? Apparently there were some bug in the static building for Qt 5.5 and it's fixed in Qt 5.6.1 (https://bugreports.qt.io/browse/QTBUG-51071). So aside from upgrading, am at a loss ...
    • UNSOLVED is it possible to run phonon player in arm based processor ?
      Mobile and Embedded • cross compile arm qt4.8.7 phonon • • Narthan  

      10
      0
      Votes
      10
      Posts
      3259
      Views

      Do you provide glib ?
    • UNSOLVED Glib support cannot be enabled due to functionality tests! in Qt 4.8 configuration to embedded ARM
      Mobile and Embedded • cross compile embedded qt qt4.8.7 glib phonon • • Narthan  

      8
      0
      Votes
      8
      Posts
      4330
      Views

      @DEEPAK-NATH I'm not the one with the problem...