c++ - Qt SDK : qhash. h error: C2872: 'uint' : ambiguous symbol

标签 c++ qt visual-studio-2012 c++11 qt5

我使用以下命令和 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/

相关文章:

c++ - 如何根据模板类型参数调用不同的函数?

c++ - Qt 我可以在构造函数中将信号/槽连接到自身吗?

c++ - glReadPixels 和 gluUnProject 无法正常工作

c++ - Boost 序列化和文件 IO 非常慢

c++ - 未使用 MinGW 的 g++ 编译器在此范围内声明 GetCurrentHwProfile

C++ 和表格格式打印

c++ - 特定的 c++ 指针/引用错误?

Qt - 工作线程上神秘的段错误

c++ - Microsoft Visual Studios 2012 无法打开 "python33.lib"

c++ - 无法在 visual studio 2012 中捕获 "ctor subscript out of range"异常