在使用Visual Studio 2010编译QT时缺少包含 [英] Missing include when compiling QT with Visual Studio 2010

查看:341
本文介绍了在使用Visual Studio 2010编译QT时缺少包含的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Windows 7 64位的Visual Studio 2010的命令提示符编译QT 5.0.0。该过程本身是已知的,并且此处此处。在我的机器上,编译停止,因为编译器没有找到一个文件:

 致命错误C1083:[..]GLES2 / gl2.h:没有这样的文件或目录

我发现丢失的文件在 C:\QTSources - 我尝试构建源文件夹。



我添加了 INCLUDEPATH + =C:/ QTSources / qtwebkit / Source / ThirdParty / ANGLE / include qtsdk.pro 文件,当我说 configure [options] 时,它似乎被qmake用于生成Makefile。建议您这样做这里,但它没有帮助。路径不会显示在Makefile和编译器的任何调用中。



如何正确声明我的include?



主要的问题是你从Qt网站下载的压缩文件不行。您必须使用Git存储库中的内容(当前版本5.0.1,但不是从下载页面获得的5.0.1版本相同)



这是我做的,一步一步,确切的:



先决条件:有git,perl,python和ruby安装,你必须检查你的路径,看看你能从任何地方访问可执行文件。在此处搜索下载链接:
http:// qt-project 。在Windows构建环境部分下的.org / wiki / Building-Qt-5-from-Git 。对于Git,请从此处下载 http://git-scm.com



然后执行以下操作:



转到要安装Qt的目录。

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

cd qt5

perl init-repository - -no-webkit

configure -developer-build -opensource -nomake示例-nomake tests


$ b b

打开一个Visual Studio x64 Win64命令提示符,查找它或者对于VS 2008你可以执行:
%comspec%/ kc:\Program Files(x86)\Microsoft Visual Studio 9.0 \VC\vcvarsall.batamd64



  SET CL = / MP 

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

然后按y接受许可条款

  nmake 

...就是这样。



原始问题的注意事项:
您问:我如何正确声明我的包含?,并在解释了您终于解决问题的方式后:。 ..我将文件所在的整个文件夹复制到编译器已知的路径...



更喜欢将文件夹保留在其原始位置,并在调用nmake之前执行以下操作:

  SET CL = / Ic:\MyFolder注意,我之前使用过SET CL = / MP,这是为了通过使用多个核心来创建更快的速度。处理器。因此,对于这种情况,您应该:

  SET CL = / MP / Ic:\MyFolder 


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?

解决方案

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

这篇关于在使用Visual Studio 2010编译QT时缺少包含的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆