Problem using QT5 configure for cross-compiling from Ubuntu to Raspberry pi3
-
I have a QT application that I am able to build and run with QT5 which was not built by me. I want to change some things with QT5 so I have set up my environment to build QT5 locally having followed several web pages on how to do so. The problem is that I don't get any farther than the configure step (see below). It doesn't matter if I just execute: "./configure -v" or a more specific command line. Either way, I get the same result. The indicated file is located in the ".../src/corelib/global" directory. Why am I getting this error during configuration?
$ ./configure -v
Creating qmake...
g++ -c -o main.o -std=c++11 -ffunction-sections -g -g -I/home/jon/raspi/qtbase-5.10.1/qmake -I/home/jon/raspi/qtbase-5.10.1/qmake/library -I/home/jon/raspi/qtbase-5.10.1/qmake/generators -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/unix -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/win32 -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/mac -I/home/jon/raspi/qtbase-5.10.1/include -I/home/jon/raspi/qtbase-5.10.1/include/QtCore -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1 -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1/QtCore -I../src/corelib/global -I/home/jon/raspi/qtbase-5.10.1/mkspecs/linux-g++ -DQT_VERSION_STR="5.10.1" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=10 -DQT_VERSION_PATCH=1 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp
In file included from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmake_global.h:32:0,
from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeparser.h:32,
from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeevaluator.h:36,
from /home/jon/raspi/qtbase-5.10.1/qmake/project.h:32,
from /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp:30:
../src/corelib/global/qglobal.h:63:10: fatal error: QtCore/qconfig-bootstrapped.h: No such file or directory
#include <QtCore/qconfig-bootstrapped.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
Hi,
Are you doing it that from a clean state ?
I'd recommend using out of source build. That way, if something goes wrong, you can simply nuke the folder and you also keep your sources clean.
-
Hi,
Are you doing it that from a clean state ?
I'd recommend using out of source build. That way, if something goes wrong, you can simply nuke the folder and you also keep your sources clean.
-
@SGaist I'm not sure in this case what constitutes a clean state. How do I make sure that I have a clean state? How do I do an out of source build? I like the idea of being able to recover by simply deleting a folder.
-
@jsulm I have a clean state then as nothing has been built. There are no ".o", ".a", or ".so" files in the source tree. No builds have been possible as 'configure' fails compilation on the first module that it attempts to build.
-
@Pablo-J.-Rogina I have an environment that allows me to currently build and run a Qt Creator application on a Raspberry pi3. That includes having already previously followed most of the steps from the guide that you suggest. The difference is that instead of using a previously build Qt base, I am trying to build a Qt base locally. Please note that the failure that I am experiencing occurs when I run the 'configure' utility and has nothing to do with my having previously installed the correct cross compiler or creating a sysroot. These both work just fine when I build the application with the Qt base that was previously built. I believe that the problem that I am trying to solve involves specifying an include path somehow to 'configure' so that it can find the 'missing' includes. Passing an additional '-I ....' string has no effect when qmake is attempting to build.
-
One thing that is strange, you say you are cross-compiling except that you are calling
configure
without any parameter related to cross-compiling. -
One thing that is strange, you say you are cross-compiling except that you are calling
configure
without any parameter related to cross-compiling.@SGaist I am successfully cross-compiling with a previously built Qt base. Here is the same result when 'configure' is given a lot more valid arguments:
$ ./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf-g++ -sysroot /usr/local/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -v
Creating qmake...
g++ -c -o main.o -std=c++11 -ffunction-sections -g -g -I/home/jon/raspi/qtbase-5.10.1/qmake -I/home/jon/raspi/qtbase-5.10.1/qmake/library -I/home/jon/raspi/qtbase-5.10.1/qmake/generators -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/unix -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/win32 -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/mac -I/home/jon/raspi/qtbase-5.10.1/include -I/home/jon/raspi/qtbase-5.10.1/include/QtCore -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1 -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1/QtCore -I../src/corelib/global -I/home/jon/raspi/qtbase-5.10.1/mkspecs/linux-g++ -DQT_VERSION_STR="5.10.1" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=10 -DQT_VERSION_PATCH=1 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp
In file included from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmake_global.h:32:0,
from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeparser.h:32,
from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeevaluator.h:36,
from /home/jon/raspi/qtbase-5.10.1/qmake/project.h:32,
from /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp:30:
../src/corelib/global/qglobal.h:63:10: fatal error: QtCore/qconfig-bootstrapped.h: No such file or directory
#include <QtCore/qconfig-bootstrapped.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I am able to get to the next 'missing' include file if I manually change file: 'qglobal.h' to specify the full path of the 'missing' include file. As I understand it, cross-compiling my Raspberry Pi application is a subsequent step to building qmake, which is what 'configure' is attempting to do. Ideas?
-
You need to have Qt cross-compiled first and then you'll be able to cross-compile your application.
Where did you get these sources from ?
-
You need to have Qt cross-compiled first and then you'll be able to cross-compile your application.
Where did you get these sources from ?
@SGaist Source for Qt base came from here: https://github.com/qt/qtbase/tree/5.10.1. It would seem that 'configure' wants to build 'qmake' first which it can't because it is unable to locate include files due to not having an include path defined. What am I missing?
-
Github is a mirror, you should rather use https://code.qt.io
It seems that the forward includes are not generated. Do you have all the dependencies to build Qt installed ?
-
Github is a mirror, you should rather use https://code.qt.io
It seems that the forward includes are not generated. Do you have all the dependencies to build Qt installed ?
-
That's strange...
Anyway, glad you found out and thanks for sharing !
Since you have it building now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)