Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Curious problems while cross-compiling Qt 5.5.1
Forum Updated to NodeBB v4.3 + New Features

Curious problems while cross-compiling Qt 5.5.1

Scheduled Pinned Locked Moved Solved Mobile and Embedded
19 Posts 4 Posters 7.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S SGaist
    22 Sept 2016, 12:05

    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.

    R Offline
    R Offline
    robdf
    wrote on 22 Sept 2016, 12:11 last edited by robdf
    #7

    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.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      robdf
      wrote on 23 Sept 2016, 13:52 last edited by
      #8

      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
      
      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dang Vu
        wrote on 23 Sept 2016, 16:31 last edited by
        #9

        i think a tutorial it that your need https://sites.google.com/site/timpicuc/Downhome/beaglebone-black/setting-up-qt-for-bbb-with-debian

        R 1 Reply Last reply 23 Sept 2016, 17:36
        0
        • D Dang Vu
          23 Sept 2016, 16:31

          i think a tutorial it that your need https://sites.google.com/site/timpicuc/Downhome/beaglebone-black/setting-up-qt-for-bbb-with-debian

          R Offline
          R Offline
          robdf
          wrote on 23 Sept 2016, 17:36 last edited by
          #10

          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!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 23 Sept 2016, 20:04 last edited by
            #11

            @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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            R 1 Reply Last reply 23 Sept 2016, 21:57
            0
            • S SGaist
              23 Sept 2016, 20:04

              @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.

              R Offline
              R Offline
              robdf
              wrote on 23 Sept 2016, 21:57 last edited by
              #12

              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?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 23 Sept 2016, 22:04 last edited by
                #13

                I'd restart from a clean state and only configure/build qtbase with the -v flag on to catch anything suspicious.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  robdf
                  wrote on 26 Sept 2016, 19:48 last edited by
                  #14

                  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...

                  S 1 Reply Last reply 24 Oct 2017, 12:03
                  1
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 26 Sept 2016, 20:29 last edited by
                    #15

                    Ok, pretty strange. Anyway, glad you found out and thanks for sharing !

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • R robdf
                      26 Sept 2016, 19:48

                      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...

                      S Offline
                      S Offline
                      surendraece08
                      wrote on 24 Oct 2017, 12:03 last edited by
                      #16

                      @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?

                      R 1 Reply Last reply 24 Oct 2017, 20:04
                      0
                      • S surendraece08
                        24 Oct 2017, 12:03

                        @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?

                        R Offline
                        R Offline
                        robdf
                        wrote on 24 Oct 2017, 20:04 last edited by
                        #17

                        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!

                        S 2 Replies Last reply 25 Oct 2017, 04:45
                        0
                        • R robdf
                          24 Oct 2017, 20:04

                          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!

                          S Offline
                          S Offline
                          surendraece08
                          wrote on 25 Oct 2017, 04:45 last edited by surendraece08
                          #18

                          @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!

                          1 Reply Last reply
                          0
                          • R robdf
                            24 Oct 2017, 20:04

                            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!

                            S Offline
                            S Offline
                            surendraece08
                            wrote on 25 Oct 2017, 06:21 last edited by
                            #19

                            @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.

                            1 Reply Last reply
                            1

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved