View Full Version : Qt vista compile

20th November 2007, 12:09
I'm compiling Qt 4.3.2 in vista with the following bat file running as administrator

set MINGWLIBEXEC=%MINGWROOT%\libexec\gcc\mingw32\3.4.2
set MINGWBIN2=%MINGWROOT%\mingw32\bin
set MINGWLIB2=%MINGWROOT%\mingw32\lib\ldscripts

set QTDIR=C:\Dev\Qt\4.3.2
set PATH=%MINGW%;C:\Dev\Qt\4.3.2\bin
set PATH=%PATH%;C:\Dev\Qt\MinGW\bin
set PATH=%PATH%;%SystemRoot%\System32
set QMAKESPEC=win32-g++


if not "%1"=="compile_debug" goto END
cd %QTDIR%
echo This will configure and compile qt in debug.
echo The release libraries will not be recompiled.
configure -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg -qt-gif
cd %QTDIR%\src
mingw32-make debug

I get those includes errors:

In file included from ..\..\3rdparty\zlib\crc32.c:29:
..\..\3rdparty\zlib\/zutil.h:21:24: stddef.h: No such file or directory
..\..\3rdparty\zlib\/zutil.h:23:22: string.h: No such file or directory
..\..\3rdparty\zlib\/zutil.h:24:22: stdlib.h: No such file or directory
..\..\3rdparty\zlib\/zutil.h:38:23: errno.h: No such file or directory
..\..\3rdparty\zlib\crc32.c:36:24: limits.h: No such file or directory
mingw32-make[2]: *** [tmp\obj\release_shared\crc32.o] Error 1
mingw32-make[2]: Leaving directory `C:/Dev/Qt/4.3.2/src/tools/rcc'
mingw32-make[1]: *** [release] Error 2
mingw32-make[1]: Leaving directory `C:/Dev/Qt/4.3.2/src/tools/rcc'
mingw32-make: *** [debug-C__Qt_4_3_2_src_tools_rcc] Error 2

I've seen other people having the same issues, so I updated the Mingw runtime, but it doesn't seem to fix anything.

Any idea?

20th November 2007, 12:40
Yes, I've had the same problem. The mingw directory has to be placed in a root folder, such as c:\mingw.

20th November 2007, 15:21
Thanks man,

Jeez, I thought those issues were fixed since Windows Nt...

19th September 2008, 11:36
I'm getting exactly the same error using QT 4.4.2 and the Mingw 5.14 installer under WinXP but I've already installed Mingw into c:\mingw so unfortunately that hasn't resolved the issue. I notice that stddef.h is located in two directories


and I've tried adding these to the PATH but still get the same issue. Is there something I need to set when initially running the QT configure stage to include these paths or is this issue more related to Mingw?

21st September 2008, 23:56
Well I figured it out in the end. It's a PATH order issue although I'm not sure what else in my path was causing the problem. By doing a

set path=c:\mingw\bin;%PATH%

just prior to running the make it gets things working. Changing the PATH in the Environment options in System under the control panel to have the mingw path at the start of the PATH does not guarantee the bin directory will be at the start of the PATH when running a command prompt. Extra paths get added to the beginning when the command prompt is started so safest bet is to reset the mingw path as a double check.

What does surprise me is that after doing a bit of a search over the net this issue is so common and not just with QT builds. Even more surprising is I didn't find any posts that mentioned doing the above. Many users with the issue went on to use a different compiler instead of mingw.