Quantcast
Channel: Qt DevNet forums: Installation and Deployment
Viewing all articles
Browse latest Browse all 2113

[SOLVED] Problems building 5.1.0 using MSVC 2012 targeting Windows XP

$
0
0
I’m on Windows 7 ×64 and I’m attempting to build Qt 5.1.0 using MSVC 2012 (Update 3). I’m trying to target Windows XP x86, however I can’t even get configure.bat to exit without errors. First the output is littered with warnings like this: c:\program files (x86)\microsoft sdks\windows\v7.1a\include\sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition (C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\library\ioutils.cpp)         C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\sal.h(2872) : see previous definition of '__useHeader' c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings_supp.h(77) : warning C4005: '__on_failure' : macro redefinition (C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\library\ioutils.cpp)         C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\sal.h(2882) : see previous definition of '__on_failure' Then the errors that kill it are: C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(612) : error C2065: 'FILE_ID_INFO' : undeclared identifier C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(612) : error C2146: syntax error : missing ';' before identifier 'infoEx' C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(612) : error C2065: 'infoEx' : undeclared identifier C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(614) : error C2065: 'infoEx' : undeclared identifier C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(614) : error C2065: 'FILE_ID_INFO' : undeclared identifier C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(614) : error C2070: ''unknown-type'': illegal sizeof operand C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(615) : error C2065: 'infoEx' : undeclared identifier C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\io\qfilesystemengine_win.cpp(615) : error C2228: left of '.VolumeSerialNumber' must have class/struct/union         type is ''unknown-type'' <snip> It looks like a conflict between the Windows 8 Kit and the Windows 7 SDK, the latter being required for targeting Windows XP using msvc2012. The steps needed to build for XP using msvc2012 are outlined here [blogs.msdn.com]. I’ve followed those steps, however looking at the compilation commands from configure’s output it seems as though the compiler define _USING_V110_SDK71_ is not being used at all, despite my specifying it. The steps I’m using to build are as follows: Start a command prompt that sets up the environment variables: set QT_SOURCE=C:\qt\5.1.0\5.1.0-windowsxp-x86-shared call "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86 set PATH=%QT_SOURCE%\qtbase\bin;%QT_SOURCE%\qtrepotools\bin;%QT_SOURCE%\gnuwin32\bin;%PATH% set QMAKESPEC=win32-msvc2012   set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE% set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Lib;%LIB% set CL=/D_USING_V110_SDK71_;%CL% I modified two lines in the makespec file qtbase\mkspecs\win32-msvc2012\qmake.conf as follows, to match the instructions at the link above: QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE,5.01 QMAKE_LFLAGS_WINDOWS    = /SUBSYSTEM:WINDOWS,5.01 Then used the following configure command from the top of the source tree (not from qtbase/): configure.bat -debug-and-release -opensource -confirm-license -c++11 -shared -ltcg -skip qtmultimedia -skip qtwebkit -skip qtwebkit-examples -skip qtquick1 -skip qtquickcontrols -skip qtjsbackend -skip qtdeclarative -nomake tests -no-icu -no-opengl -no-angle -no-audio-backend -no-qml-debug -plugin-sql-sqlite -I C:\OpenSSL-Win32\include -L C:\OpenSSL-Win32\lib -openssl -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -mp Here is an example compiler call from configure’s output: Creating qmake...  cl -c -Fo./  -W3 -nologo -O1  /MP  -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\library -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\generators -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\generators\unix -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\generators\win32 -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\generators\mac -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\generators\integrity  -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\include -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\include\QtCore -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\include\QtCore\5.1.0 -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\include\QtCore\5.1.0\QtCore  -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\src\corelib\global -DHAVE_QCONFIG_CPP  -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\mkspecs\win32-msvc2012   -IC:\qt\5.1.0\5.1.0-windowsxp-x86-shared\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  -DUNICODE -c -Yc -Fpqmake_pch.pch -TP C:\qt\5.1.0\5.1.0-windowsxp-x86-shared\qtbase\qmake\qmake_pch.h No mention of the define _USING_V110_SDK71_ Why not? I tried specifying it both in the CL environment variable and in the configure command (using -D), neither method worked. Qt builds fine if I don’t target XP. How do I overcome these errors?

Viewing all articles
Browse latest Browse all 2113

Trending Articles