Missing include when compiling QT with Visual Studio 2010

command-line, include, qt, visual-studio-2010

Solution

I had the same problem and I finally found the solution (the only difference is that I'm using VS 2008, but I'm using Windows 7, and I needed the 64 bit target as you).

The main problem is that the compressed file that you download from the Qt site is not ok. You have to use what is in the Git repository (currently version 5.0.1, but not the same as the 5.0.1 version that you get from the downloads page)

Here is what I did, step by step, exactly:

prerequisites: have git, perl, python and ruby installed, you have to check your path to see if you can access the executables from anywhere. Search for download links here: http://qt-project.org/wiki/Building-Qt-5-from-Git under "Windows Build environment" section. For Git, download it from here http://git-scm.com

then do the following:

go to the directory where you want to install Qt.

git clone git://gitorious.org/qt/qt5.git qt5

cd qt5

perl init-repository --no-webkit

configure -developer-build -opensource -nomake examples -nomake tests

open a Visual Studio x64 Win64 Command Prompt, look for it or for VS 2008 you can execute: %comspec% /k ""c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" amd64

inside that window:

SET CL=/MP

configure -developer-build -opensource -nomake examples -nomake tests -opengl desktop

then press "y" for accepting the licence terms

nmake

...and that's all.

Note to the original question: You asked "How can I properly declare my include?" and after you explained the way you finally solved it: "...I copied the whole folder in which the file resides into a path known to the compiler...".

Instead of doing that, you might prefer to leave the folder in its original location and do the following before calling nmake:

SET CL=/Ic:\MyFolder

Note that I used SET CL=/MP before, that's for building faster by using the multiple cores of the processor. So, for that case, you should do:

SET CL=/MP /Ic:\MyFolder

Problem

I try to compile QT 5.0.0 in the command prompt of Visual Studio 2010 on Windows 7, 64bit. The process itself is known and described here and here. On my machine, compilation stops because the compiler does not find a file: ``` fatal error C1083: [..] "GLES2/gl2.h": No such file or directory ``` I found that missing file in a subdirectory of `C:\QTSources` - the folder in which I try to build the sources. I added the line `INCLUDEPATH += "C:/QTSources/qtwebkit/Source/ThirdParty/ANGLE/include"` to the file qtsdk.pro which seems to be used by qmake for the generation of the Makefile when I say `configure [options]`. This is suggested to do so here but it does not help. The path does show up neither in the Makefile nor in any call to the compiler. How can I properly declare my include?

Original source

Related problems