I am trying to build Qt with Microsoft's 64-bit compiler. I downloaded qt-everywhere-opensource-src-4.8.0.tar.gz
from the Qt downloads page and extracted it to D:\Qt
. After launching the x64 Cross Tools Command Prompt, I ran the following commands:
set QTDIR=D:\Qt set PATH=%PATH%;%QTDIR%\bin configure.exe -debug-and-release -opensource -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -qt-style-windowsxp -qt-style-windowsvista -platform win32-msvc2010
The process went quite smoothly for a few minutes, but abruptly stopped with the following error:
... qurl.cpp qsettings_win.cpp NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 11.0\VC\BI N\x86_amd64\cl.EXE"' : return code '0x2' Stop. Building qmake failed, return code 2
I have no clue what is causing that error or what to do about it - the error message is far less than helpful. Here is what my system looks like:
Edit: if I cd
into the qmake
directory and run nmake
, we discover the actual error:
qfilesystemengine_win.cpp qfsfileengine_win.cpp D:\Qt\src\corelib\io\qfsfileengine_win.cpp(64) : fatal error C1083: Cannot open include file: 'shlobj.h': No such file or directory D:\Qt\src\corelib\io\qfilesystemengine_win.cpp(66) : fatal error C1083: Cannot o pen include file: 'shlobj.h': No such file or directory NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 11.0\VC\BI N\x86_amd64\cl.EXE"' : return code '0x2' Stop.
Why is shlobj.h
missing?
The Visual Studio 11 Beta Express for Windows 8 only supports Metro style applications. It doesn't include the full SDK.
To build Qt, you'll need one of the other Visual Studio 11 Beta SKUs, which you can download from the Visual Studio website. The Ultimate SKU certainly includes <shlobj.h>
, and probably any other missing headers (of course, that doesn't necessarily mean that Qt will build; it may inadvertently rely on quirks in Visual C++ 2010 or the Beta may have bugs that prevent it from building; your mileage may vary).
I know this is an old question but I had this issue and the answer wasn't too helpful any more.
This missing file can be found in the windows SDKs. If they are missing you must be missing an SDK. For VS 2010 install the Windows 7.1 SDK and respectively for VS 2012 you will need the windows 8 SDK. Default file locations after install:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With