我使用以下命令和 VS2012 64 位编译器从源代码编译了 Qt 5.2.1:
configure -prefix c:\Qt\Qt5.2.1\msvc2012_opengl -mp -debug-and-release -opengl desktop -c++11 -opensource -D _CRT_SECURE_NO_WARNINGS -nomake examples -skip qtwebkit-examples && nmake && nmake install
现在在 QtEditor 中使用 VS2012 编译器编译我的项目时,我在 qhash.h 中收到此错误:
C:\Qt\Qt5.2.1\5.2.1\msvc2012_opengl\include\QtCore\qhash.h:777: error: C2872: 'uint' : ambiguous symbol
我为什么会收到它,如何解决?
即使仅使用 QApplication 编译 main.cpp 时我也能得到它:
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
return a.exec();
}
更新:
我找到了。它是 GLM Math typedefs uint 的库。我通过为每个 glm 类型使用 glm::命名空间来解决它。事实上,我想知道为什么 Qt API 没有命名空间这样的常用定义。
最佳答案
您可能在 Qt 之外对该类型有冲突的定义,例如在 Qt/C++ 和您正在使用的第三方依赖项中。
附带说明一下,没有QtEditor
这样的东西。
关于c++ - Qt SDK : qhash. h error: C2872: 'uint' : ambiguous symbol,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23676506/