Curious problems while cross-compiling Qt 5.5.1
-
Really, just go out of the source tree.
You should also either cleanup the sources you have or just nuke the whole Qt folder and start from a new never configured source tree to avoid having artifacts of your other attempts going in the way.
Hi @SGaist, thank you again for the feedback.
I had already cleaned up the sources - I always start from scratch after unpacking the archive to a new directory. This time I went out of the source tree, like you suggested. I created a "build" folder parallel to the source folder (so: sources in ~/ev-sdk/qt/qt551/qt2 and build in ~/ev-sdk/qt/qt551/build), and launched the configure script from there, with --prefix ~/ev-sdk/qt/qt551/qt2/install - so a subfolder of the sources, like you previously recommended.
The result is exactly the same as my last message, no more, no less... wrong #includes in QtXmlPatternsDepends and build stops.
So, once again, looking for enlightenment. Thanks in advance!
-
One other thing's not clear. You thread title mention cross-compiling however you don't seem to provide anything related to that in your configure options.
-
One other thing's not clear. You thread title mention cross-compiling however you don't seem to provide anything related to that in your configure options.
As mentioned on top, I use Scratchbox 2. It enables you to abstract away the host machine when cross compiling for a target.
So, instead of calling "./configure ..." I call "sb2 -t <target> ./configure"; and later "sb2 -t <target> make" instead of just "make". This does the trick. I cross-compiled without any problems Qt 4.8.4 this way.
-
Hmm, it seems like there are no clues?
I tried to overcome the problem by avoiding to compile the QtXmlPatterns submodule (by adding -skip qtxmlpatterns to the configure parameters). But then I just get exactly the same troubles with QtQml/QtQmlDepends...
I don't want to give up, but I have no ideas how to get that to work...
cd qtdeclarative/ && ( test -e Makefile || /home/user/ev-sdk/qt/qt551/build/qtbase/bin/qmake /home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/qtdeclarative.pro -o Makefile ) && make -f Makefile Project WARNING: qmake spec does not announce the compiler family. Guessed gcc. Info: creating cache file /home/user/ev-sdk/qt/qt551/build/qtdeclarative/.qmake.cache /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. make[1]: Entering directory `/home/user/ev-sdk/qt/qt551/build/qtdeclarative' cd src/ && ( test -e Makefile || /home/user/ev-sdk/qt/qt551/build/qtbase/bin/qmake /home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/src.pro -o Makefile ) && make -f Makefile Project WARNING: qmake spec does not announce the compiler family. Guessed gcc. /home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/src.pro:6: 'qtHaveModule' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function. make[2]: Entering directory `/home/user/ev-sdk/qt/qt551/build/qtdeclarative/src' cd qml/ && ( test -e Makefile || /home/user/ev-sdk/qt/qt551/build/qtbase/bin/qmake /home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml/qml.pro -o Makefile ) && make -f Makefile Project WARNING: qmake spec does not announce the compiler family. Guessed gcc. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_module.prf:246: 'qt5LibraryTarget' is not a recognized replace function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs.prf:56: 'qtAddToolEnv' is not a recognized test function. Project MESSAGE: Warning: unknown QT: core-private WARNING: TARGET is empty make[3]: Entering directory `/home/user/ev-sdk/qt/qt551/build/qtdeclarative/src/qml' g++ -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_INTEGER_EVENT_COORDINATES -DQT_BUILD_QML_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DWTF_EXPORT_PRIVATE= -DJS_EXPORT_PRIVATE= -DWTFReportAssertionFailure=qmlWTFReportAssertionFailure -DWTFReportBacktrace=qmlWTFReportBacktrace -DWTFInvokeCrashHook=qmlWTFInvokeCrashHook -DENABLE_LLINT=0 -DENABLE_DFG_JIT=0 -DENABLE_DFG_JIT_UTILITY_METHODS=1 -DENABLE_JIT_CONSTANT_BLINDING=0 -DBUILDING_QT__ -DWTF_USE_UDIS86=0 -DNDEBUG -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_NETWORK_LIB -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml -I. -I/home/user/ev-sdk/qt/qt551/qt2/install/include/QtNetwork -I/home/user/ev-sdk/qt/qt551/qt2/install/include -I/home/user/ev-sdk/mysql/mysql-5.6.10/include -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/include -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/include/QtQml -I../../include -I../../include/QtQml -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/include/QtQml/5.5.1 -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/include/QtQml/5.5.1/QtQml -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml/compiler -I. -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/jit -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/assembler -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/runtime -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/wtf -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/stubs -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/stubs/wtf -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/disassembler -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/masm/disassembler/udis86 -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml/jit -I. -I.generated -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml/jsruntime -I. -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/3rdparty/double-conversion -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml/debugger -I/home/user/ev-sdk/qt/qt551/qt2/qtdeclarative/src/qml/animations -I.moc -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/mkspecs/linux-g++ -x c++-header -c ../../include/QtQml/QtQmlDepends -o .pch/.gch/c++ ../../include/QtQml/QtQmlDepends:3:13: error: /: No such file or directory
-
i think a tutorial it that your need https://sites.google.com/site/timpicuc/Downhome/beaglebone-black/setting-up-qt-for-bbb-with-debian
-
i think a tutorial it that your need https://sites.google.com/site/timpicuc/Downhome/beaglebone-black/setting-up-qt-for-bbb-with-debian
Hi @Dang-Vu, thank you for your reply.
Well, I'll surely have a look. The point here is that I already have a virtual machine with toolchain for cross-compiling for my target. This was not prepared by me, but it's part of a BSP which comes with the embedded board itself. So it's all ready and configured. As said, I could build from scratch without problems Qt 4.8.
If you see something specific wrong with my process (I think it's quite well described in detail), would you please point that out?
To me, the point is that the configuration script and intermediate build processes generate files which have strange "wrong" things inside. I mean, if there's "#include </>" inside a file generated by qmake, doesn't this mean there's something strange?
Thanks for any additional inputs!
-
@robdf Please have some patience, you didn't even wait 24 hours.
As for your problem:
WARNING educated guess ahead.
One of the difference between Qt 4 and Qt 5 is that Qt 4 was monolithic so everything was prepared at configure time and then after that it was only a build step. However with Qt 5, the configure step setup things to build qtbase and then the modules are "configured" and built one after the other using qmake. What might be happening is that the way you use scratchbox doesn't play well with that setup. IIRC, you can "login" into scratchbox to get a console configured for your target. That might be a better solution to build Qt 5.
-
@robdf Please have some patience, you didn't even wait 24 hours.
As for your problem:
WARNING educated guess ahead.
One of the difference between Qt 4 and Qt 5 is that Qt 4 was monolithic so everything was prepared at configure time and then after that it was only a build step. However with Qt 5, the configure step setup things to build qtbase and then the modules are "configured" and built one after the other using qmake. What might be happening is that the way you use scratchbox doesn't play well with that setup. IIRC, you can "login" into scratchbox to get a console configured for your target. That might be a better solution to build Qt 5.
Hi @SGaist, thank you for your input. Sorry if I seemed impatient, that was not my intention. I know that it takes time to read out such things, and mostly everyone's here in the "spare" time.
I tried opening a Scratchbox console for my target and launching everything from there (after cleaning up, of course). Same problems.
Now my attention anyway was captured by some error messages in the log, right before the failure:
make[2]: Entering directory `/home/user/ev-sdk/qt/qt551/build/qtxmlpatterns/src' cd xmlpatterns/ && ( test -e Makefile || /home/user/ev-sdk/qt/qt551/build/qtbase/bin/qmake /home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/xmlpatterns.pro -o Makefile ) && make -f Makefile Project WARNING: qmake spec does not announce the compiler family. Guessed gcc. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_module.prf:246: 'qt5LibraryTarget' is not a recognized replace function. /home/user/ev-sdk/qt/qt551/qt2/qtbase/mkspecs/features/qt_docs.prf:56: 'qtAddToolEnv' is not a recognized test function. Project MESSAGE: Warning: unknown QT: core-private WARNING: TARGET is empty [...] ../../include/QtXmlPatterns/QtXmlPatternsDepends:3:13: error: /: No such file or directory
So there's this qt5LibraryTarget not recognized. As the name suggests, this might be used in the script as a "replace function" for the library path during compilation. This might lead to that famous generated #include </> in QtXmlPatternsDepends.
Similar error messages appear also during the configuration progress. There it says, for example, at the end, qt_docs_targets.prf:31: 'prepareRecursiveTarget' is not a recognized test function.. But then it says Qt is ready for building, so up to now I didn't give that too much importance. Is that maybe relevant? Any ideas why these "test functions" and "replace functions" are not recognized?
-
I'd restart from a clean state and only configure/build qtbase with the -v flag on to catch anything suspicious.
-
So, I found the problem and managed to successfully build.
After the configure process, I had a look at the generated Makefile. There is a section where different project files (.prf) are "included". I noticed something strange: some of those files were correctly included from the source subfolder "qtbase/mkspecs/features/" but some others, instead, from a folder located into the file system image of the target:
[...] ../../../rootfs/arm-a8-fs/usr/mkspecs/features/qt_functions.prf \ ../../../rootfs/arm-a8-fs/usr/mkspecs/features/qt_config.prf \ [...] qtbase/mkspecs/features/qt_build_config.prf \ [...]
For example, some of the not recognized replace or test functions are located in qt_functions.prf, and this was not loaded from the correct location. This file was not loaded from the QT5 source distribution, but in that subfolder of the target file system. I don't know the reason, I had no time to investigate as I needed to go on with my job. I copied all the "features" from the source code to the "features" folder in the distribution, and from then on no problems anymore...
-
Ok, pretty strange. Anyway, glad you found out and thanks for sharing !
-
So, I found the problem and managed to successfully build.
After the configure process, I had a look at the generated Makefile. There is a section where different project files (.prf) are "included". I noticed something strange: some of those files were correctly included from the source subfolder "qtbase/mkspecs/features/" but some others, instead, from a folder located into the file system image of the target:
[...] ../../../rootfs/arm-a8-fs/usr/mkspecs/features/qt_functions.prf \ ../../../rootfs/arm-a8-fs/usr/mkspecs/features/qt_config.prf \ [...] qtbase/mkspecs/features/qt_build_config.prf \ [...]
For example, some of the not recognized replace or test functions are located in qt_functions.prf, and this was not loaded from the correct location. This file was not loaded from the QT5 source distribution, but in that subfolder of the target file system. I don't know the reason, I had no time to investigate as I needed to go on with my job. I copied all the "features" from the source code to the "features" folder in the distribution, and from then on no problems anymore...
@robdf I have the same error. I copied all the files from source to target file system as you mentioned and I couldn't get the error resolved. The solution you provided is very uncertain! Could you make it little clear?
-
@robdf I have the same error. I copied all the files from source to target file system as you mentioned and I couldn't get the error resolved. The solution you provided is very uncertain! Could you make it little clear?
Hi @surendraece08, almost one year has now passed and I admit I can't recall all details. I'm sorry if my description of how I solved the problem sounds unclear.
As far as I remember, I copied the content of the "features" folder into the target file system, where some old .prf files were found, probably from a previous attempt (not by me) to compile previous versions of Qt. Maybe this could be a problem in case you would like later to be able to compile Qt programs using different toolkit versions.
I guess you could also try first to remove that .../rootfs/arm-a8-fs/usr/mkspecs folder (or, for safety, rename to something else), so that the configuration script would not find those old .prf files.
Clean everything and launch the configuration script every time you make a change. After that, check the Makefile to see which .prf files are referenced.
Good luck!
-
Hi @surendraece08, almost one year has now passed and I admit I can't recall all details. I'm sorry if my description of how I solved the problem sounds unclear.
As far as I remember, I copied the content of the "features" folder into the target file system, where some old .prf files were found, probably from a previous attempt (not by me) to compile previous versions of Qt. Maybe this could be a problem in case you would like later to be able to compile Qt programs using different toolkit versions.
I guess you could also try first to remove that .../rootfs/arm-a8-fs/usr/mkspecs folder (or, for safety, rename to something else), so that the configuration script would not find those old .prf files.
Clean everything and launch the configuration script every time you make a change. After that, check the Makefile to see which .prf files are referenced.
Good luck!
@robdf I appreciate you for your time to reply, which you have no need to!
I've copied the mkspecs directory from source to target as you've suggested. But I see the same error again.
Anyway, I will figure out a way to solve this.
Have a good day! -
Hi @surendraece08, almost one year has now passed and I admit I can't recall all details. I'm sorry if my description of how I solved the problem sounds unclear.
As far as I remember, I copied the content of the "features" folder into the target file system, where some old .prf files were found, probably from a previous attempt (not by me) to compile previous versions of Qt. Maybe this could be a problem in case you would like later to be able to compile Qt programs using different toolkit versions.
I guess you could also try first to remove that .../rootfs/arm-a8-fs/usr/mkspecs folder (or, for safety, rename to something else), so that the configuration script would not find those old .prf files.
Clean everything and launch the configuration script every time you make a change. After that, check the Makefile to see which .prf files are referenced.
Good luck!
@robdf After some thorough research, I found the solution.
For the error like not a recognized replace function, bitbake is unable to locate the function definition. In my case, the error is:bld-agl/tmp/work/x86_64-linux/qtbase-native/5.7.1+gitAUTOINC+a55f36211e-r0/git/mkspecs/features/qt_helper_lib.prf:32: 'qt5LibraryTarget' is not a recognized replace function.
So, in the file qt_helper_lib.prf, I added the following line.
loads(qt_functions)
The function qt5LibraryTarget is defined in the qu_functions.prf file.
Similarly, one can add the location of respective function definition, which throws error, in the load section of the respective .prf file.