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. Compile Qt 5.1.1 with Cygwin (64bit) shipped MinGW64 compiler on Windows 7
QtWS25 Last Chance

Compile Qt 5.1.1 with Cygwin (64bit) shipped MinGW64 compiler on Windows 7

Scheduled Pinned Locked Moved Installation and Deployment
36 Posts 4 Posters 21.0k 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.
  • P Offline
    P Offline
    phdggg
    wrote on 2 Oct 2013, 03:45 last edited by
    #1

    Hi All,

    I installed the MingGW64 compilers shipped with Cygwin64 (mingw64-x86_64-gcc-core, mingw64-x86_64-gcc-g++). I would like to use them to compile Qt 5.1.1. Note I am not using the one from official MingGW-w64 website but I used those installed from Cygwin64.

    I ran "./configure.bat -opensource -debug-and-release". It gave me some errors:

    Unable to detect the platform from environment. Use -platform command lineargume
    nt or set the QMAKESPEC environment variable and run configure again
    See the README file for a list of supported operating systems and compilers.

    So I rerun with "./configure.bat -platform win32-g++ -opensource -debug-and-release". win32-g++ is the closest mkspec I could find. It gave me some errors too:

    Creating qmake...
    execute: File or path is not found (mingw32-make)
    execute: File or path is not found (mingw32-make)
    Cleaning qmake failed, return code -1

    I believe mingw32-make is not shipped with Cygwin. I only have a "make" under /bin.

    I am kind of stuck here. I think I need a better mkspec for my setup. Can anyone help? I don't think any spec under qtbase/mkspecs/ suffices.

    Thanks,
    Mengda

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 2 Oct 2013, 06:40 last edited by
      #2

      You need to modify the mkspecs and point it to right binaries (make instead of mingw32-make). Make specs are located in <qt source code>/mkspecs

      (Z(:^

      1 Reply Last reply
      0
      • P Offline
        P Offline
        phdggg
        wrote on 2 Oct 2013, 18:56 last edited by
        #3

        I'd appreciate if you can provide a mkspec that works. I spent several hours trying and had no luck.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 4 Oct 2013, 05:50 last edited by
          #4

          You just need to follow all dependencies (makefiles in mkspecs do have "include" statements) and verify that all the paths and executable names are correct for your setup. I won't do this for you, sorry. If you want it easy, use one of the prebuilt solutions, or switch to Linux where everything just works.

          (Z(:^

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JKSH
            Moderators
            wrote on 4 Oct 2013, 06:15 last edited by
            #5

            Are you planning to use any of the UNIX functionality that Cygwin provides? If not, just get the prebuilt native MinGW package: "Qt 5.1.1 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MB" at http://qt-project.org/downloads

            It even comes with the MinGW toolchain

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mr_Ada
              wrote on 23 Oct 2013, 05:27 last edited by
              #6

              I ran into this before with the mkspecs. I want to compile Qt 5.1.1 so that I can get ".a" files I can debug with. I am writing Ada bindings and I have been a little successful in creating objects in Ada and passing it to the C++ world. Widgets and pushbuttons seem to be fine. Labels no. So if had Qt all "-g"d then I can traverse through the code to see if I am not converting something properly which is keeping the object from showing. I have tried to compile with windoze but no luck. I can't even get an SDK for XP64!

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mr_Ada
                wrote on 23 Oct 2013, 05:28 last edited by
                #7

                Also I had to do a dos2unix on the ascii files from the opensource file!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sierdzio
                  Moderators
                  wrote on 23 Oct 2013, 06:54 last edited by
                  #8

                  Mr_Ada If you download the source code as a .zip, it will have Windows line endings. If you want Unix ones, download the tarball.

                  And in general, if you want to do unix stuff, compile on Linux and you will save yourself a lot of trouble :)

                  To compile Qt with debug symbols, just pass -developer-build to configure.

                  (Z(:^

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mr_Ada
                    wrote on 23 Oct 2013, 06:58 last edited by
                    #9

                    I'll try the tarball on Cygwin but I'd still would like to be able to compile on Windows XP64 since I do a lot of my development on Windows. I'll go to linux (probably Ubuntu) and see if my bindings to Ada work there as well.

                    In older versions of Qt they provided debug libraries. Now it is a real pain.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Mr_Ada
                      wrote on 23 Oct 2013, 07:16 last edited by
                      #10

                      Creating qmake...
                      g++ -c -o project.o -pipe -g -g -DQMAKE_OPENSOURCE_EDITION -I/cygdrive/c/qt_src/qtbase/qmake -I/cygdrive/c/qt_src/qtbase/qmake/library -I/cygdrive/c/qt_src/qtbase/qmake/generators -I/cygdrive/c/qt_src/qtbase/qmake/generators/unix -I/cygdrive/c/qt_src/qtbase/qmake/generators/win32 -I/cygdrive/c/qt_src/qtbase/qmake/generators/mac -I/cygdrive/c/qt_src/qtbase/qmake/generators/integrity -I/cygdrive/c/qt_src/qtbase/include -I/cygdrive/c/qt_src/qtbase/include/QtCore -I/cygdrive/c/qt_src/qtbase/include/QtCore/5.1.1 -I/cygdrive/c/qt_src/qtbase/include/QtCore/5.1.1/QtCore -I/cygdrive/c/qt_src/qtbase/src/corelib/global -DHAVE_QCONFIG_CPP -I/cygdrive/c/qt_src/qtbase/mkspecs/cygwin-g++ -I/cygdrive/c/qt_src/qtbase/tools/shared -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DPROEVALUATOR_DEBUG -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM /cygdrive/c/qt_src/qtbase/qmake/project.cpp
                      g++.exe: error: /cygdrive/c/qt_src/qtbase/qmake/project.cpp: No such file or directory

                      g++.exe: fatal error: no input files

                      compilation terminated.

                      Makefile:163: recipe for target 'project.o' failed
                      make: *** [project.o] Error

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        Mr_Ada
                        wrote on 23 Oct 2013, 07:18 last edited by
                        #11

                        That is the error I got. The files does exist where it says it does. My g++ is the Qt5 binary distributions at:
                        $ g++ -v
                        Using built-in specs.
                        COLLECT_GCC=C:\Qt5\Tools\mingw48_32\bin\g++.exe
                        COLLECT_LTO_WRAPPER=c:/qt5/tools/mingw48_32/bin/../libexec/gcc/i686-w64-mingw32/4.8.0/lto-wrapper.exe
                        Target: i686-w64-mingw32
                        Configured with: ../../../src/gcc-4.8.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/temp/x32-480-posix-dwarf-r2/mingw32 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-host-libstdcxx='-static -lstdc++' --with-libiconv --with-system-zlib --with-gmp=/temp/mingw-prereq/i686-w64-mingw32-static --with-mpfr=/temp/mingw-prereq/i686-w64-mingw32-static --with-mpc=/temp/mingw-prereq/i686-w64-mingw32-static --with-isl=/temp/mingw-prereq/i686-w64-mingw32-static --with-cloog=/temp/mingw-prereq/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='rev2, Built by MinGW-builds project' --with-bugurl=http://sourceforge.net/projects/mingwbuilds/ CFLAGS='-O2 -pipe -I/temp/x32-480-posix-dwarf-r2/libs/include -I/temp/mingw-prereq/x32-zlib/include -I/temp/mingw-prereq/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/temp/x32-480-posix-dwarf-r2/libs/include -I/temp/mingw-prereq/x32-zlib/include -I/temp/mingw-prereq/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/temp/x32-480-posix-dwarf-r2/libs/lib -L/temp/mingw-prereq/x32-zlib/lib -L/temp/mingw-prereq/i686-w64-mingw32-static/lib -L/temp/x32-480-posix-dwarf-r2/mingw32/opt/lib'
                        Thread model: posix
                        gcc version 4.8.0 (rev2, Built by MinGW-builds project)

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          Mr_Ada
                          wrote on 23 Oct 2013, 07:18 last edited by
                          #12

                          My configure command is:
                          ./configure -prefix /cygdrive/c/Qt5d -debug -developer-build -opensource -confirm-license -static -platform cygwin-g++ -qt-zlib -qt-libpng -qt-libjpeg -verbose

                          1 Reply Last reply
                          0
                          • J Offline
                            J Offline
                            JKSH
                            Moderators
                            wrote on 23 Oct 2013, 07:59 last edited by
                            #13

                            I'm not sure if you can use the Win32 (native Windows) variant of MinGW on Cygwin. You might need a copy of MinGW that was specifically built for Cygwin.

                            -I do know, however, that the configure script doesn't work on Windows, even within Cygwin. You'll need to run configure.bat instead.- EDIT: Sorry, I was thinking of MSYS, not Cygwin!

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              Mr_Ada
                              wrote on 23 Oct 2013, 14:00 last edited by
                              #14

                              intersting! I would not have expected a DOS script to work in CYGWIN!

                              1 Reply Last reply
                              0
                              • J Offline
                                J Offline
                                JKSH
                                Moderators
                                wrote on 23 Oct 2013, 14:14 last edited by
                                #15

                                Ack, sorry, I just realized I remembered wrongly. I was thinking of MSYS, not Cygwin! I've never tried compiling Qt on Cygwin before.

                                But like I said in your other thread, you'll probably have better luck doing a native Windows build instead of a Cygwin build which adds a POSIX layer to your system.

                                [quote]
                                @
                                COLLECT_GCC=C:\Qt5\Tools\mingw48_32\bin\g++.exe
                                @
                                [/quote]That's a native Windows toolchain, so I doubt that works on Cygwin either.

                                What errors do you get when you try to compile in CMD?

                                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  Mr_Ada
                                  wrote on 23 Oct 2013, 14:46 last edited by
                                  #16

                                  Ok. My toolchain was wrong, so I fixed my path. Here is an output (I changed the folder name so that I didn't have it so long):
                                  C:\qt_src>configure -prefix C:\Qt5d -debug -developer-build -opensource -confirm -license -static -platform cygwin-g++ -qt-zlib -qt-libpng -qt-libjpeg -verbose

                                  • cd qtbase
                                  • C:\qt_src\qtbase\configure.bat -prefix C:\Qt5d -debug -developer-build -opensource -confirm-license -static -platform cygwin-g++ -qt-zlib -qt-libpng -qt-libjpeg -verbose
                                    'C:\qt_src\qtbase\configure.exe' is not recognized as an internal or external command, operable program or batch file
                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    Mr_Ada
                                    wrote on 23 Oct 2013, 14:47 last edited by
                                    #17

                                    strange that it would look for an exe when there is a bat file there.

                                    I think I am using the tarball source code. Maybe that is throwing things off....

                                    1 Reply Last reply
                                    0
                                    • J Offline
                                      J Offline
                                      JKSH
                                      Moderators
                                      wrote on 23 Oct 2013, 14:52 last edited by
                                      #18

                                      [quote]
                                      @

                                      • cd qtbase
                                      • C:\qt_src\qtbase\configure.bat -prefix C:\Qt5d -debug -developer-build -opensource -confirm-license -static -platform cygwin-g++ -qt-zlib -qt-libpng -qt-libjpeg -verbose
                                        @
                                        [/quote]
                                        Don't go into 'qtbase'. Call configure.bat in C:\qt_src, and then call make in C:\qt_src.

                                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        Mr_Ada
                                        wrote on 23 Oct 2013, 15:01 last edited by
                                        #19

                                        first I had to resintall the Zip file instead of the tarball and I got a little further. It didn't like my -verbose so I took that out.

                                        Then I ran it again and I got:
                                        make.exe - Unable to Locate Component
                                        This application has failed to start because msys-1.0.dll was not found. Re-installing the application may fix this problem.

                                        What does msys have to do with all of this?

                                        Also I am not going down to qtbase. I am calling this from the qt_src level.

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          Mr_Ada
                                          wrote on 23 Oct 2013, 15:09 last edited by
                                          #20

                                          so I cleaned up my PATH so only the one mingw toolchain was visible (Qt's).

                                          Ran again and got this:

                                          C:\qt_src>configure -prefix C:\Qt5d -debug -developer-build -opensource -confirm-license -static -platform cygwin-g++ -qt-zlib -qt-libpng -qt-libjpeg

                                          • cd qtbase
                                          • C:\qt_src\qtbase\configure.bat -prefix C:\Qt5d -debug -developer-build -opensource -confirm-license -static -platform cygwin-g++ -qt-zlib -qt-libpng -qt-libjpeg

                                          This is the Qt for Windows Open Source Edition.

                                          You have already accepted the terms of the license.

                                          Creating qmake...
                                          Cleaning qmake failed, return code -1

                                          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