Cross Compiling Qt onto Pi problems
-
I have the Pi root file system mounted and I am able to navigate through. Which library files am I looking for? Do these go under the Qt Version setting or the compiler setting?
-
Did you call make install after you cross-compiled Qt ?
-
Forgive me if this sounds stupid, but if I have Qt4 installed on the Pi from downloading the binaries (https://wiki.qt.io/Apt-get_Qt4_on_the_Raspberry_Pi), then I didnt think I needed to compile Qt again. Does that package not have what is required?
-
Again, it's the native package for the Pi so compiled for ARM including the tools like qmake, you can use it directly on the Pi but not on your desktop machine (the error you got earlier comes from that)
-
Ok, I think I got a little bit further. I have done this tutorial
http://www.hertaville.com/cross-compiling-qt4-app.html
I was able to mount the RPi root system, and I am on the example part. There isnt a make file on that page. There is an image though. After the word "make" in the command line, there is a lot of text. This is essentially the make file right?
I am trying to apply what I have now with qt creator and looking at the Configuring Qt Creator part here, http://raspberry-qt.org/#binaries
Im at the line, "Click "Add..." and select "/usr/local/qt5pi/bin/qmake""
and its saying I need to run make install. You mentioned that before. But if I try to do that, it says,bradley@bradley-VirtualBox:~/rpi/2013-03-22-raspberry-qt/qt5pi/bin$ make install
make: *** No rule to make target `install'. Stop.And if I wanted to use qt4, then I need the qt4 folder like that theirs. what is it? How did they create that folder? Is it just downloaded from the qt website?
Thank you for all of the guidance!
-
You should call
make install
in the same folder you called make before.Qt 4 is natively build for ARM. Raspbian is a Debian derivative and thus gives access to a lot of packages. However if you want to use your desktop computer to build Qt 4 application for the Raspberry Pi you again need to first cross-compile Qt 4.
-
hello SGaist,
I have gone through many guides to cross compile QT4 on x86 but none is complete
so please if possible can you explain the procedure to cross compile QT4 for ARM
sorry for my english. -
What did you do ? What didn't work ?
-
hello,
I have followed this linkhttp://www.hertaville.com/cross-compiling-qt4-app.html
but it is using make file for cross compiling the application whereas I want to build Qmake and configure Qt Creator for cross compilation.
-
Did you first cross-compile Qt 4 ?
-
Hi! I have a problem with configuration Qt5 on Raspberry Pi with Raspbian. I follow this instruction: https://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi and after I called instruction ./configure -v -opengl es2 -device linux-rasp-pi-g''+ -device-option CROSS_COMPILE=/usr/bin/ -opensource
-confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5 &> output, the process didn't stop. I was waiting about 1 hour and process 'cc1plus' still was performing, so is there other way to configure qt5 for cross-compile?Note: I didn't use patch file from the instruction.
Edit: I switched off Raspberry and next day, the same instruction took few seconds. But I'm not sure if the 'output' file is ok. my output looks diffrent than output file from the example in instruction, is that normal?
But there is other problem: next instuction: 'make &> output_make' takes few hours and it did't stop so I killed it. This time output_make file is very big and it's growing while processing, so how long should it process? -
I tried cross compiling Qt 5, And I got about 2 hours into it when I got this message.
I dont really know what this means. Did it complete? What do the error 1 and 2s mean?../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:95:68: error: declaration of C function ‘int vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T, DISPMANX_ELEMENT_HANDLE_T, uint32_t, int32_t, uint8_t, const VC_RECT_T, const VC_RECT_T*, DISPMANX_RESOURCE_HANDLE_T, VC_IMAGE_TRANSFORM_T)’ conflicts with
In file included from /mnt/raspberry-rootfs/opt/vc/include/EGL/eglplatform.h:110:0,
from /mnt/raspberry-rootfs/opt/vc/include/EGL/egl.h:36,
from ./qeglfshooks.h:48,
from ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:42:
/mnt/raspberry-rootfs/opt/vc/include/interface/vmcs_host/vc_dispmanx.h:108:22: error: previous declaration ‘int vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T, DISPMANX_ELEMENT_HANDLE_T, uint32_t, int32_t, uint8_t, const VC_RECT_T*, const VC_RECT_T*, DISPMANX_RESOURCE_HANDLE_T, DISPMANX_TRANSFORM_T)’ here
../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:195:10: warning: unused parameter ‘window’ [-Wunused-parameter]
In file included from ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:42:0:
./qeglfshooks.h:74:21: warning: ‘hooks’ defined but not used [-Wunused-variable]
make[4]: *** [.obj/release-shared/qeglfshooks_pi.o] Error 1
make[4]: Leaving directory/home/bradley/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src/plugins/platforms/eglfs' make[3]: *** [sub-eglfs-make_first] Error 2 make[3]: Leaving directory
/home/bradley/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src/plugins/platforms'
make[2]: *** [sub-platforms-make_first] Error 2
make[2]: Leaving directory/home/bradley/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src/plugins' make[1]: *** [sub-plugins-make_first] Error 2 make[1]: Leaving directory
/home/bradley/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase/src'
make: *** [sub-src-make_first] Error 2
bradley@bradley-VirtualBox:~/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase$ ^C
bradley@bradley-VirtualBox:~/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase$ ^C
bradley@bradley-VirtualBox:~/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase$ ^C
bradley@bradley-VirtualBox:~/raspberry/qt-everywhere-opensource-src-5.0.2/qtbase$* -
So....after running into more problems with the other online tutorials, I went back to the original Qt wiki tutorial. When I first looked at it months back, I couldnt follow it through, so I looked for other ways. This time, I was able to understand and navigate through the steps. I can now cross compile Qt programs from my Windows PC!
I used Ubuntu in VirtualBox, with a Raspbian image mounted! (Raspbian->Ubuntu->Windows)->RaspbianThanks for the help here on the forums. Its been months of reading and learning about linux.
For anyone who wants to do the same, you can contact me.
I did notice two things not mentioned on the wiki page.
First, that there was a path error. Wherever it uses "/mnt/rasp-pi-rootfs", it should be "~/opt/mnt/rasp-pi-rootfs"I wouldnt have known how to spot the error or how to fix it without the arduous process of learning linux.
Second, after you unmount the root filesystem after cross compiling Qt5 and put it onto the SD card, the Raspberry will not boot. Dont worry, just do what it asks:
password, then type "fsck"