Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Tool definition for linux cross-compilation on windows
Forum Updated to NodeBB v4.3 + New Features

Tool definition for linux cross-compilation on windows

Scheduled Pinned Locked Moved Installation and Deployment
36 Posts 5 Posters 14.1k Views 1 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.
  • M Offline
    M Offline
    marius.maximus
    wrote on last edited by
    #15

    I have this same error and have sollution for this.
    But forget do "git push" and update on github

    Please look into my 03_configure.bat agine.

    After call configure I update few broken files.

    @echo QT_CONFIG += xkbcommon-qt >>mkspecs\qconfig.pri
    echo static const char qt_configure_settings_path_str[256 + 12] = "qt_stngpath=/usr/local/Qt-5.2.0/etc/xdg"; >>src\corelib\global\qconfig.cpp
    echo #define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12; >>src\corelib\global\qconfig.cpp

    @

    1 Reply Last reply
    0
    • M Offline
      M Offline
      marius.maximus
      wrote on last edited by
      #16

      In my opinion qtbase\tools\configure
      has small BUG

      @
      enum Platforms {
      WINDOWS,
      WINDOWS_CE,
      WINDOWS_RT,
      QNX,
      BLACKBERRY,
      ANDROID
      };@

      configure don't have platform LINUX and default is WINDOWS

      thi is BUG line 3871 in configureapp.cpp

      @ if ((platform() != WINDOWS) && (platform() != WINDOWS_CE) && (platform() != WINDOWS_RT))
      tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12;" << endl;
      @

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #17

        [quote author="marius.maximus" date="1391535321"]I have this same error and have sollution for this.
        But forget do "git push" and update on github

        Please look into my 03_configure.bat agine.

        After call configure I update few broken files.

        @echo QT_CONFIG += xkbcommon-qt >>mkspecs\qconfig.pri
        echo static const char qt_configure_settings_path_str[256 + 12] = "qt_stngpath=/usr/local/Qt-5.2.0/etc/xdg"; >>src\corelib\global\qconfig.cpp
        echo #define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12; >>src\corelib\global\qconfig.cpp

        @
        [/quote]

        Trying to understand what you are doing. I am a bit puzzled because this
        @
        "qt_stngpath=/usr/local/Qt-5.2.0/etc/xdg";
        @

        is a linux path, but we are on windows.

        The subsequent post for configureapp.cpp is referring to the same thing.

        Now the question comes up where platform relates to. We are on a windows platform but doing a cross-compilation to linux.

        I had downloaded the sources as tar.gz because linux is the target.

        A final question what is the source archive you used?
        .zip or tar.gz ?

        I had downloaded tar.gz because linux is the target.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marius.maximus
          wrote on last edited by
          #18

          is a linux path but we are on windows, but it is cross-compilation for linux ;)

          I cross compile for my ARM in linux x86 and compare files created in windows and linux. And add missing things ;)

          I used ZIP on windows 8.1 and tar.gz on linux x86

          In my opinion platform() should look like this :

          @int Configure::platform() const
          {
          const QString qMakeSpec = dictionary.value("QMAKESPEC");
          const QString xQMakeSpec = dictionary.value("XQMAKESPEC");

          if ((xQMakeSpec.startsWith("winphone") || xQMakeSpec.startsWith("winrt")))
              return WINDOWS_RT;
          
          if ((qMakeSpec.startsWith("wince") || xQMakeSpec.startsWith("wince")))
              return WINDOWS_CE;
          
          if (xQMakeSpec.contains("qnx"))
              return QNX;
          
          if (xQMakeSpec.contains("blackberry"))
              return BLACKBERRY;
          
          if (xQMakeSpec.contains("android"))
              return ANDROID;
          

          //////////////////// BEGIN add by marius.maximus //
          if (xQMakeSpec.startsWith("linux"))
          return LINUX;
          //////////////////// END add by marius.maximus //

          return WINDOWS;
          

          }
          @

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #19

            You have a point there. However, it is not logical that this should be missing for longer already. So the concept might be different and not requiring linux explicitly.

            You could file a bug report on "JIRA":https://bugreports.qt-project.org/secure/Dashboard.jspa on this.

            Did you succeed with the cross-compilation on windows or are still stuck with other problems in between?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              marius.maximus
              wrote on last edited by
              #20

              bq. You have a point there. However, it is not logical that this should be missing for longer already. So the concept might be different and not requiring linux explicitly.

              Maybe nobody sent the patch;)

              Jira is my favorite bugreports tool I have my own and I'm admin ;)

              All works OK , I tessted it on this module
              http://www.toradex.com/products/colibri-arm-computer-modules/colibri-t20 It is tegra II
              After compile I add it to QtCreateor compile few examples and run it .
              It works !

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #21

                Thanks for reply. Good to know that you succeeded. I will give it a further shot then.

                With JIRA I meant "Qt JIRA.":https://bugreports.qt-project.org/secure/Dashboard.jspa If nobody raises the issue, nobody will take care.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #22

                  Still the same issue with echoing fix you have posted.
                  I have tried with Qt5.1 as already posted before and this is the trial with Qt5.2.1 released today.
                  @
                  arm-uclinuxeabi-g++ -c -pipe -mthumb -march=armv7 -mfix-cortex-m3-ldrd -g -fPIC -std=c++0x -Wall -W -D_REENTRANT -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_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 -DPCRE_HAVE_CONFIG_H -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I....\mkspecs\linux-arm-uclinuxeabi-g++ -I. -I....\inc
                  lude -I....\include\QtCore -I....\include\QtCore\5.2.1 -I....\include\QtCore\5.2.1\QtCore -Iglobal -I..\3rdparty\pcre -I..\3rdparty\harfbuzz\src -I..\3rdparty\md5 -I..\3rdparty\md4 -I..\3rdparty\sha3 -I.moc -o .obj\qlibraryinfo
                  .obj global\qlibraryinfo.cpp
                  global\qlibraryinfo.cpp: In static member function 'static QString QLibraryInfo::location(QLibraryInfo::LibraryLocation)':
                  global\qlibraryinfo.cpp:363:20: error: 'QT_CONFIGURE_SETTINGS_PATH' was not declared in this scope
                  Makefile:11126: recipe for target '.obj\qlibraryinfo.obj' failed
                  mingw32-make[3]: *** [.obj\qlibraryinfo.obj] Error 1
                  mingw32-make[3]: Leaving directory 'c:/Qt/Qt5/5.2.1/Qt5.2.1_Source_Wnds/qtbase/src/corelib'
                  Makefile:129: recipe for target 'sub-corelib-make_first' failed
                  mingw32-make[2]: *** [sub-corelib-make_first] Error 2
                  mingw32-make[2]: Leaving directory 'c:/Qt/Qt5/5.2.1/Qt5.2.1_Source_Wnds/qtbase/src'
                  Makefile:41: recipe for target 'sub-src-make_first' failed
                  mingw32-make[1]: *** [sub-src-make_first] Error 2
                  mingw32-make[1]: Leaving directory 'c:/Qt/Qt5/5.2.1/Qt5.2.1_Source_Wnds/qtbase'
                  makefile:60: recipe for target 'module-qtbase-make_first' failed
                  mingw32-make: *** [module-qtbase-make_first] Error 2

                  c:\Qt\Qt5\5.2.1\Qt5.2.1_Source_Wnds>
                  @

                  This is the code section (line 363 is shown as line 6 below)
                  @
                  const char *path = 0;
                  if (unsigned(loc) < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0]))
                  path = qt_configure_prefix_path_strs[loc] + 12;
                  #ifndef Q_OS_WIN // On Windows we use the registry
                  else if (loc == SettingsPath)
                  path = QT_CONFIGURE_SETTINGS_PATH;
                  #endif
                  @

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    marius.maximus
                    wrote on last edited by
                    #23

                    QT_CONFIGURE_SETTINGS_PATH should be created by configure

                    But configure don't create it (it is bug)

                    You must by hand add it to
                    src\corelib\global\qconfig.cpp

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #24

                      You are completely right. Even though I had checked it before with other version it was not carried with version 5.2.1.
                      I did not use the "call configure.bat" and the three subsequent echos are ignored.

                      Sorry my fault.

                      It goes further now, but eventually comes up with the next problem.

                      @
                      arm-uclinuxeabi-g++ -c -pipe -mthumb -march=armv7 -mfix-cortex-m3-ldrd -g -fPIC -std=c++0x -Wall -W -D_REENTRANT -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_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 -DPCRE_HAVE_CONFIG_H -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I....\mkspecs\linux-arm-uclinuxeabi-g++ -I. -I....\inc
                      lude -I....\include\QtCore -I....\include\QtCore\5.2.1 -I....\include\QtCore\5.2.1\QtCore -Iglobal -I..\3rdparty\pcre -I..\3rdparty\harfbuzz\src -I..\3rdparty\md5 -I..\3rdparty\md4 -I..\3rdparty\sha3 -I.moc -o .obj\qwaitconditi
                      on_unix.obj thread\qwaitcondition_unix.cpp
                      thread\qwaitcondition_unix.cpp: In function 'void qt_initialize_pthread_cond(pthread_cond_t*, const char*)':
                      thread\qwaitcondition_unix.cpp:83:61: error: 'pthread_condattr_setclock' was not declared in this scope
                      Makefile:13335: recipe for target '.obj\qwaitcondition_unix.obj' failed
                      mingw32-make[3]: *** [.obj\qwaitcondition_unix.obj] Error 1
                      mingw32-make[3]: Leaving directory 'c:/Qt/Qt5/5.2.1/Qt5.2.1_Source_Wnds/qtbase/src/corelib'
                      Makefile:129: recipe for target 'sub-corelib-make_first' failed
                      mingw32-make[2]: *** [sub-corelib-make_first] Error 2
                      mingw32-make[2]: Leaving directory 'c:/Qt/Qt5/5.2.1/Qt5.2.1_Source_Wnds/qtbase/src'
                      Makefile:41: recipe for target 'sub-src-make_first' failed
                      mingw32-make[1]: *** [sub-src-make_first] Error 2
                      mingw32-make[1]: Leaving directory 'c:/Qt/Qt5/5.2.1/Qt5.2.1_Source_Wnds/qtbase'
                      makefile:60: recipe for target 'module-qtbase-make_first' failed
                      mingw32-make: *** [module-qtbase-make_first] Error 2

                      c:\Qt\Qt5\5.2.1\Qt5.2.1_Source_Wnds>
                      @

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        marius.maximus
                        wrote on last edited by
                        #25

                        Maybe your toolchain do not have pthread_condattr_setclock ?

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          marius.maximus
                          wrote on last edited by
                          #26

                          I see 5.2.1 , Ooooo new Qt release ;)

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #27

                            [quote author="marius.maximus" date="1391721007"]Maybe your toolchain do not have pthread_condattr_setclock ?
                            [/quote]

                            Yes, you are probably right. I was not able to track this one down before posting. However, I suspected already the same as you.

                            [quote author="marius.maximus" date="1391722383"]I see 5.2.1 , Ooooo new Qt release ;)[/quote]

                            Yes, I must have downloaded while it was very fresh. Unfortunately, it did not change things.

                            [edit, koahnig]

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              marius.maximus
                              wrote on last edited by
                              #28

                              Please
                              comment line with pthread_condattr_setclock function call
                              In corelib/thread/qwaitcondition_unix.cpp

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                class101
                                wrote on last edited by
                                #29

                                How did you fix this issues guys ? I'm seriously considering down grading to Qt4 that do not have these problems

                                1 Reply Last reply
                                0
                                • K Offline
                                  K Offline
                                  koahnig
                                  wrote on last edited by
                                  #30

                                  [quote author="class101" date="1396092288"]How did you fix this issues guys ? I'm seriously considering down grading to Qt4 that do not have these problems[/quote]

                                  I saw that I am having not only these issues when compiling on windows. I decided to continue the route on Ubuntu until having a solution. However, also there are remaining some questions waiting for a solution.
                                  Since I had to shift priorities, I am having a couple of loose ends in that respect.

                                  Do you have a solution with Qt4?

                                  Vote the answer(s) that helped you to solve your issue(s)

                                  1 Reply Last reply
                                  0
                                  • C Offline
                                    C Offline
                                    class101
                                    wrote on last edited by
                                    #31

                                    For QT_CONFIGURE_SETTINGS_PATH
                                    In Qt4 (4.8.6 - https://qt.gitorious.org/qt/qt) there is no solution because there is no issue like that as far I tested only Qt5 brings this issue.

                                    For the other issue switching Windows commands by Linux commands I have found that it also comes from a Qt5 regression

                                    in unix.conf, this line is new from Qt5 and instead should be changed to
                                    @include(shell-unix.conf)@

                                    unix.conf
                                    @!isEmpty(QMAKE_SH) {
                                    include(shell-unix.conf)
                                    } else {
                                    include(shell-win32.conf)
                                    }@

                                    Will try marlus solution about the first issue, completely ignored its comment my bad, may be working

                                    But now I'm building my own qmake.conf with most unnecessary and conflicting += to = and I save it somewhere else so I will not experience regression issues in the future and I have a better control on the options that are used, I think that's the best we can do instead of counting on configuration you can include but not supporting Windows operating system...

                                    1 Reply Last reply
                                    0
                                    • K Offline
                                      K Offline
                                      koahnig
                                      wrote on last edited by
                                      #32

                                      I would interested to know of your progress, I will continue with this effort when having solved the other issues. It would make live a bit easier.

                                      Vote the answer(s) that helped you to solve your issue(s)

                                      1 Reply Last reply
                                      0
                                      • C Offline
                                        C Offline
                                        class101
                                        wrote on last edited by
                                        #33

                                        Sure, What are you other issues? I may have solved them here

                                        Me I fail near the end when compiling plugins

                                        @x86_64-unknown-linux-gnu-g++ -pipe -m64 -w -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,X:/libs/qt-5_3_0/qt-linux64-gcc48/lib -o libqsqlite.so .obj\smain.obj .obj\qsql_sqlite.obj .obj\sqlite3.obj .obj\moc_qsql_sqlit
                                        e_p.obj -LX:/libs/qt5/qtbase/lib -lQt5Sql -lQt5Core -lpthread
                                        X:/libs/compilers/gcc-4.8.2-x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../x86_64-unknown-linux-gnu/lib/../lib64/crt1.o: In function _start': (.text+0x20): undefined reference to main'
                                        collect2.exe: error: ld returned 1 exit status
                                        Makefile:159: recipe for target '........\plugins\sqldrivers\libqsqlite.so' failed@

                                        1 Reply Last reply
                                        0
                                        • K Offline
                                          K Offline
                                          koahnig
                                          wrote on last edited by
                                          #34

                                          UCLinux is the problem or not that the issue. So it is more that I still need to be convinced that UCLinux will not create more problems for me. Since I am compiling at the moment under Ubuntu, I bypassing the obvious windows issues.

                                          Can you compile other plugins without a problem?

                                          Vote the answer(s) that helped you to solve your issue(s)

                                          1 Reply Last reply
                                          0

                                          • Login

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