Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Build errors in cross compile Qt for embedded linux
I always get below mentioned errors in qtbase and qtwayland when I cross compile code for embedded linux
Errors are mainly in below two categories,
Related to header file include missing:
../../include/QtCore/../../src/corelib/io/qtextstream.h:46:2: error: #error qtextstream.h must be included before any header file that defines Status
Related double defined types like Bool, KeyPress, KeyRelease, FontChange, CursorShape etc.
/home/rbhagwat/sources/temp/linux/include/X11/Xlib.h:86:14: error: expected identifier before 'int'
#define Bool int
full error log of qtbase is here
Which version of Qt are you cross-compiling ?
For what platform/board ?
What options did you pass to configure ?
I've same issue with multiple Qt versions like 5.4.2, dev, Qt 5.6.0.
I'm building it for tegra platform
./configure -platform linux-g++ -xplatform linux-tegra-g++ -pkg-config -no-directfb -no-linuxfb -eglfs -system-xcb -cups -nis -no-pch -largefile -accessibility -opengl -glib -icu -dbus -evdev -no-rpath -release -verbose -opensource -confirm-license -sysroot "$SYSROOT_DIR" -extprefix "$QtInstallDir"
I may be wrong but
-system-xcblooks suspicious for a cross-compiling configuration. Do you have all these libs available for your target ?
Yes, I've all deps/libs in my sysroot, I'm able to cross compile Qt by resolving build errors. Problem is I need to create patches of fixing build issues and maintain it per Qt version.
I'm expecting, Qt should be built w/o any build errors.
I've to create patch like this in order to fix build issues in qtbase
It should yes, that's why I'm thinking there something funky going one. Did you get the sources from git ?
Yes, I'm using source from git. Am I doing something wrong here?
No no, it was just to know where you got the sources from.
What distribution do you have on your sysroot ?
But what Linux distribution are you using for your target sysroot ?
Ubuntu on the target and as sysroot ?
Ubuntu 15.04 is on target. I created sysroot by downloading arm 64 bit deb packages to resolve all Qt dependencies on host.
One possibility is to add the QTextStream include where that error appears.
As for the X11 related errors, try moving the X11 includes after the Qt includes.
My intention behind starting this discussion is to avoid resolving build errors when I sync up or switch to new Qt version at my side. As I mentioned I've already resolved build errors and created patches for some Qt versions. But if those errors are fixed there itself as these are genuine build errors then developer do not have to resolve these errors for linux embedded platforms.
Did you submit your patches for inclusion in Qt ?