Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Qt 5.4.2构建问题-无角度-msvc2010上无opengl_C++_Qt_Visual Studio 2010_Opengl_Nmake - Fatal编程技术网

C++ Qt 5.4.2构建问题-无角度-msvc2010上无opengl

C++ Qt 5.4.2构建问题-无角度-msvc2010上无opengl,c++,qt,visual-studio-2010,opengl,nmake,C++,Qt,Visual Studio 2010,Opengl,Nmake,正如标题中所述,我在Qt5.4.2构建过程中遇到了奇怪的行为 我想让qt能够使用静态libs编译二进制文件,因此下面是我的配置选项: configure -static -release -platform win32-msvc2010 -qt-sql-db2 -qt-sql-odbc -no-angle -no-opengl 起初没有-没有角度-没有opengl,但我添加它是为了消除nmake错误 然而,即使在configure中禁用了opengl,我仍然会遇到opengl构建错误 Open

正如标题中所述,我在Qt5.4.2构建过程中遇到了奇怪的行为

我想让qt能够使用静态libs编译二进制文件,因此下面是我的
配置
选项:

configure -static -release -platform win32-msvc2010 -qt-sql-db2 -qt-sql-odbc
-no-angle -no-opengl
起初没有
-没有角度-没有opengl
,但我添加它是为了消除nmake错误

然而,即使在configure中禁用了opengl,我仍然会遇到opengl构建错误

OpenGL support..............no
nmake
之后:

c:\qt-src-5.4.2\qtbase\include\qtgui\5.4.2\qtgui\private\../../../../../src/gui/
opengl/qopenglextensions_p.h(147) : error C2059: syntax error: )
c:\qt-src-5.4.2\qtbase\include\qtgui\5.4.2\qtgui\private\../../../../../src/gui/
opengl/qopenglextensions_p.h(147) : error C2061: syntax error: identifier
 "GLint"
c:\qt-src-5.4.2\qtbase\include\qtgui\5.4.2\qtgui\private\../../../../../src/gui/
opengl/qopenglextensions_p.h(147) : fatal error C1003:  error count exceeds 100; 
stopping compilation.
Generating code...
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\
VC\BIN\amd64\cl.EXE" : return code "0x2"
Stop.
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\
VC\BIN\amd64\nmake.exe" : return code "0x2"
Stop.
NMAKE : fatal error U1077: cd : return code "0x2"
Stop.
NMAKE : fatal error U1077: cd : return code "0x2"
Stop.
NMAKE : fatal error U1077: cd : return code "0x2"
Stop.
我也尝试过
-opengldesktop
,但它只会导致类似的失败,就在不久之后

通过该选项,Qt告诉您:

qaccessible.cpp
c:\qt-src-5.4.2\qtbase\include\qtgui\../../src/gui/opengl/qopengl.h(99) : fatal
error C1083: Cannot open include file: GLES2/gl2.h: No such file or dir
ectory
qaccessiblecache.cpp
qaccessibleobject.cpp
qaccessibleplugin.cpp
qplatformaccessibility.cpp
qaccessiblebridge.cpp
Generating code...
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\
VC\BIN\amd64\cl.EXE" : return code "0x2"
Stop.
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\
VC\BIN\amd64\nmake.exe" : return code "0x2"
Stop.
NMAKE : fatal error U1077: cd : return code "0x2"
Stop.
NMAKE : fatal error U1077: cd : return code "0x2"
Stop.
NMAKE : fatal error U1077: cd : return code "0x2"
Stop.

我应该怎么做才能成功编译Qt?

您需要在MSVC项目解决方案中包含指向director GES的路径,其中包含各种头文件。该错误表示缺少头文件

或者,您可以添加如下目录:


-L“Path/to/GES/directory”

不要在Qt中使用
nmake
。使用
jom
。不确定这是否与问题有关,但由于构建并行化,至少Qt own
jom
更快,并保证与Qt build兼容。我没有成功解决该问题。移至Qt 5.8和msvc 2015。似乎msvc2010不受支持。如果有必要完全使用msvc2010,您最好坚持使用qt4变体(qt4.8工作正常,但对我来说太旧了),很抱歉回复太晚。不过,这种方法对我并不适用。