QT5.12.x Raspberry Pi Zero Cross Compilation QCoreApplication Error
I'm battling with trying to get cross compiling working on a VM box using Ubuntu.
I followed these instructions https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/ but for QT 5.12.1 and tried QT5.12.2 and have the same problem. The cross compilation seemed to build OK, the only issue was that Qtdoc was skipped. Qt5 was build t in a folder ~/raspi/qt5pi
However, the problem is with my demo project in QT Creator. I open up the project and get presented with compilation errors on a simple QT quick demo (Also tried QT widgets, but get similar).
Digging deeper QCoreApplication.h fails with this:
My instinct is telling me that this is a potential path issue.
Can you help me? I am new to the world of QT and cross compiling.
koahnig last edited by
This seems to be an issue with the code model. Under windows 10 I have sometimes the issue that the updating is delayed or not executed at all. Restarting Qt creator may help.
Otherwise you can deselect the code model under "Options"->"C++" under tab "Codel model". The code model takes quite some CPU times. When using a virtual machine you simply might not have enough steam for all done in real-time.
The code model shall help you to detect issues sooner and not to wait for the compilation of code and the error/warning messages there.
Thanks for your quick reply,
I just tried that, but it made no difference. I should have probably mentioned that If I build under a version of Desktop Qt 5.12.1 GCC I don't have this issue.:
And the application deploys and works.
koahnig last edited by
You have simply changed the toolchain to host and the problem is vanishing in the same creator session?
That would point an issue with the toolchain setup.
Did you check the setup of the RPI toolchain under "Option"->"Kits" all different tabs?
However, you wrote that the cross-compilation does work regardless of the warnings and messages shown in creator.
Just saw that there was a misunderstanding on my side. Check the kit.
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.
Compiler Path (C & C++):