Why am I getting this error when I try to build Qt from source code in Visual Studio 11 Express Beta?

I am trying to create Qt with a 64-bit Microsoft compiler. I downloaded qt-everywhere-opensource-src-4.8.0.tar.gz from the Qt download page and extracted it in D:\Qt . After running 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 several minutes, but suddenly 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 do not know what causes this error or what to do with it - the error message is much less than useful. This is what my system looks like:

  • Windows 8 Consumer Preview 32-bit
  • Visual Studio 11.0.50.214.1 Beta Express for Windows 8

Edit: if I cd into the qmake directory and run nmake , we find 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?

+4
source share
4 answers

Visual Studio 11 Beta Express for Windows 8 only supports Metro style apps. It does not include the full SDK.

To build Qt, you will need one of the other beta versions of Visual Studio 11 Beta, which you can download from the Visual Studio site . Ultimate SKU certainly includes <shlobj.h> and possibly any other missing headers (of course, this does not necessarily mean that Qt will build, it can inadvertently rely on quirks in Visual C ++ 2010, or in beta -version may be errors, building, your mileage may vary).

+5
source

I know this is an old question, but I had this problem and the answer was not very helpful.

This missing file can be found in the Windows SDK. If they are missing, you do not need to have an SDK. For VS 2010, install the Windows 7.1 SDK and, accordingly, for VS 2012 you will need the Windows 8 SDK. Default location of files after installation:

  • Windows 8 SDK:
  • C: \ Program Files (x86) \ Windows Kits \ 8.0 \ Include \ um
  • WIndows 7 SDK:
  • C: \ Program Files \ Microsoft SDK \ Windows \ v7.1 \ Include
  • C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Include
+2
source

Error code 0x2 corresponds to ERROR_FILE_NOT_FOUND . It is best to assume that one of the cl.exe arguments is missing. Based on the output, I would say that qsettings_win.cpp is not in the current path or is not present on the disk.

0
source

I encountered the same error when trying to create Qt 5.3 Beta strong> for WinRT ,

I was on Windows 8.1 with VS 2013 (Professional) installed. To solve the problem, I had to:

  • Download and install the Windows 8.1 SDK . It will be placed in C:\Program Files (x86)\Windows Kits\8.1 ;
  • Use VS2013 x86 Command line for native tools , available in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts .
0
source

Source: https://habr.com/ru/post/1399443/


All Articles