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

Curious problems while cross-compiling Qt 5.5.1

Scheduled Pinned Locked Moved Solved Mobile and Embedded
19 Posts 4 Posters 7.7k Views
  • 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.
  • R Offline
    R Offline
    robdf
    wrote on last edited by
    #1

    Hi everyone,

    since some days I'm trying to cross-compile Qt 5.5.1 for an ARM target. To make the story short: for this I've got an Ubuntu Virtual Machine which contains the cross-compilation toolkit (Scratchbox). Gcc version is 4.4.4. With this machine I already successfully compiled Qt 4.8.4.

    These are the parameters of my configure script:

    sb2 -t imx53 ./configure -v -prefix $PWD/qtbase -opensource -release -plugin-sql-sqlite -plugin-sql-sqlite2 \
    -no-c++11 -qt-zlib -qt-libpng -qt-libjpeg -no-opengl -qt-xcb \
    -nomake examples -nomake tools -no-compile-examples -no-directfb -no-linuxfb -no-tslib \
    -I/home/user/ev-sdk/mysql/mysql-5.6.10/include
    

    This does its job and I'm then ready to start the compilation itself. Well, ok, now it goes on for a while and it sometimes stops for strange (to my eyes at least) reasons, which I was up to now able to fix. To make it short: I had to manually update:

    • qtbase/src/platformsupport/devicediscovery/devicediscovery.pri (I had undefined reference to `vtable for QDeviceDiscoveryDummy')
    • qtbase/src/plugins/platforms/xcb/qxcbkeyboard.cpp (something about missing XK_dead_currency)
    • qtbase/src/corelib/global/qnamespace.h (same issue as the previous one)
    • qtbase/src/corelib/io/io.pri (I had undefined reference to `QInotifyFileSystemWatcherEngine::create(QObject*))

    Ok, let's say I didn't fully understand why I needed to fix myself some of these things, but nevermind, it goes on (which is what I need at the moment) and compiles and links many sections of the libraries (libQt5Core, libQt5DBud, Gui, Network, Sql, Widgets...).

    But then it stops again, and here it becomes tricky.

    g++ -c -include .pch/ -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST -DQT_BUILD_XMLPATTERNS_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 -DYYLTYPE_IS_DECLARED=1 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_NETWORK_LIB -I. -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include/QtNetwork -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include -I/home/user/ev-sdk/mysql/mysql-5.6.10/include -I../../include -I../../include/QtXmlPatterns -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include/QtXmlPatterns -I../../include/QtXmlPatterns/5.5.1 -I../../include/QtXmlPatterns/5.5.1/QtXmlPatterns -Iacceltree -Idata -Iapi -Ienvironment -Iexpr -Ifunctions -Iiterators -Ijanitors -Iparser -Ischema -Itype -Iutils -I.moc -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/mkspecs/linux-g++ -o .obj/qacceltree.o acceltree/qacceltree.cpp
    acceltree/qacceltree.cpp:34:18: error: QStack: No such file or directory
    [...]
    

    Why QStack: No such file or directory? Something must be wrong with include paths in the generated Makefile... Isn't that already strange? Ok, then I look into qtxmlpatterns/src/xmlpatterns/Makefile, and that's what I see:

    INCPATH       = -I. -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include/QtNetwork \
                    -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include \
                    -I/home/user/ev-sdk/mysql/mysql-5.6.10/include \
                    -I../../include -I../../include/QtXmlPatterns \
                    -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include \
                    -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include/QtXmlPatterns \
                    -I../../include/QtXmlPatterns/5.5.1 \
                    -I../../include/QtXmlPatterns/5.5.1/QtXmlPatterns \
                    -Iacceltree -Idata -Iapi -Ienvironment -Iexpr -Ifunctions -Iiterators -Ijanitors -Iparser \
                    -Ischema -Itype -Iutils -I.moc -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/mkspecs/linux-g++
    

    Why two entries for -I/home/user/ev-sdk/qt/qt551/qt/qtbase/include? And QStack is in [...]/include/QtCore. Why isn't this path included? Then I add it manually editing the Makefile. Another run, and I get error: private/qxmlutils_p.h: No such file or directory. Ok, then, for this I need to manually add also [...]/include/QtCore/5.5.1/QtCore/ to the include paths.

    Then it goes on with compiling for a while... but seriously, why should such manual interventions be needed? What's wrong there?

    But well, I wouldn't even mind if in the end it would work. But here's how it soon ends:

    g++ -Wl,--no-undefined -Wl,-O1 -shared -Wl,-soname,lib.so.5 -o lib.so.5.5.1 .obj/qacceltree.o .obj/qacceltreeresourceloader.o .obj/qacceliterators.o [...a whole bunch of .o files]  -L/home/user/ev-sdk/qt/qt551/qt/qtbase/lib -lQtNetwork -lpthread -lrt  
    /home/user/ev-sdk/bin/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-ld: cannot find -lQtNetwork
    

    First of all, -o lib.so.5.5.1? Which library name is this supposed to be? And then, -lQtNetwork? I have no libQtNetwork.so.* anywhere in the build tree... there'd be a libQt5Network.so.5.5.1, which was already compiled and linked earlier in the process. Ok, I even tried to change this manually into -lQt5Network, at least it finds it in the path, but no way to link successfully. Undefined references to QArrayData::shared_null, QUrl::QUrl() and dozens more (mostly for the module qacceltree.cpp - the one which started giving the "curious" problems).

    I'm looking forward to any ideas...

    Thanks in advance! All the best!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Just to rule out the obvious, I'd do an out of source build rather than in source with the prefix set in a subfolder of the sources.

      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
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Just to rule out the obvious, I'd do an out of source build rather than in source with the prefix set in a subfolder of the sources.

        R Offline
        R Offline
        robdf
        wrote on last edited by
        #3

        Hi @SGaist, thank you for your answer.

        Ok then, I started from scratch, I created a subdirectory "build", moved there and launched ../configure with --prefix pointing to a subdirectory "install" of the source code root (so "build" and "install" are sisters).

        So now it's even nicer... it stops as soon as it starts getting into xmlpatterns. And here's what I get generated in build/qtxmlpatterns/include/QtXmlPatterns/QtXmlPatternsDepends:

        /* This file was generated by qmake with the info from <root>/src/xmlpatterns/xmlpatterns.pro. */
        #ifdef __cplusplus /* create empty PCH in C mode */
        #include </>
        #include </>
        #endif
        

        which leads to:

        make[3]: Entering directory `/home/user/ev-sdk/qt/qt551/qt2/build/qtxmlpatterns/src/xmlpatterns'
        g++ -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST -DQT_BUILD_XMLPATTERNS_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 -DYYLTYPE_IS_DECLARED=1 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_NETWORK_LIB -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns -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/qtxmlpatterns/include -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/include/QtXmlPatterns -I../../include -I../../include/QtXmlPatterns -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/include/QtXmlPatterns/5.5.1 -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/include/QtXmlPatterns/5.5.1/QtXmlPatterns -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/acceltree -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/data -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/api -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/environment -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/expr -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/functions -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/iterators -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/janitors -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/parser -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/schema -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/type -I/home/user/ev-sdk/qt/qt551/qt2/qtxmlpatterns/src/xmlpatterns/utils -I.moc -I/home/user/ev-sdk/rootfs/arm-a8-fs/usr/mkspecs/linux-g++ -x c++-header -c ../../include/QtXmlPatterns/QtXmlPatternsDepends -o .pch/.gch/c++
        ../../include/QtXmlPatterns/QtXmlPatternsDepends:3:13: error: /: No such file or directory
        

        Is something wrong with some script somewhere?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          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
          0
          • SGaistS SGaist

            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.

            R Offline
            R Offline
            robdf
            wrote on last edited by
            #5

            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!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              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
              0
              • SGaistS SGaist

                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 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 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 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
                    0
                    • D Dang Vu

                      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 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
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 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
                        0
                        • SGaistS SGaist

                          @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 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
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 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 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
                              1
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on 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

                                  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 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
                                  0
                                  • S surendraece08

                                    @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 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
                                    0
                                    • R robdf

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

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