Compile Qt 5.1.1 with Cygwin (64bit) shipped MinGW64 compiler on Windows 7
-
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.
-
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.
-
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 directoryg++.exe: fatal error: no input files
compilation terminated.
Makefile:163: recipe for target 'project.o' failed
make: *** [project.o] Error -
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) -
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!
-
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?
-
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
-
[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.
-
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.
-
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 -
got this:
Running configuration tests...
WARNING: The DirectX SDK could not be detected:
There is no Direct X SDK installed or the environment variable "DXSDK_DIR" is not set.
Disabling the ANGLE backend.WARNING: Using OpenGL ES 2.0 without ANGLE.
Specify -opengl desktop to use Open GL.
The build will most likely fail.config info...
then it said to:
Qt is now configured for building. Just run mingw32-make.This doesn't exist in the tool chain. neither does make.
chris -
You have two choices:
- Install the DirectX SDK, or
- Add "-opengl desktop" to your configuration flags (your graphics card drivers needs to support OpenGL 2.0 or newer).
In either case, make sure you clean your source tree first and the re-configure.
If you're using the copy of MinGW that came with Qt 5.1, then mingw32-make should be in the 'bin' folder together with g++
-
Ok. it stopped compiling. Here is what it is complaining about:
mingw32-make[4]: Entering directory 'C:/qt_src/qtbase/src/widgets'
(set PATH=C:\qt_src\qtbase\lib;%PATH:)=^)%) & C:\qt_src\qtbase\bin\uic.exe dialogs\qfiledialog.ui -o ui_qfiledialog.h
Makefile.Debug:647: recipe for target 'ui_qfiledialog.h' failed
mingw32-make[4]: *** [ui_qfiledialog.h] Error 255
mingw32-make[4]: Leaving directory 'C:/qt_src/qtbase/src/widgets'
Makefile:34: recipe for target 'debug' failed
mingw32-make[3]: *** [debug] Error 2
mingw32-make[3]: Leaving directory 'C:/qt_src/qtbase/src/widgets'
Makefile:411: recipe for target 'sub-widgets-make_first' failed
mingw32-make[2]: *** [sub-widgets-make_first] Error 2
mingw32-make[2]: Leaving directory 'C:/qt_src/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_src/qtbase'
makefile:56: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2