C2061:语法错误:qtypetraits.h中的标识符"L"

Rob*_*bin 3 c++ qt visual-c++ casablanca

现在这花了我很多时间,所以如果其他人有这个问题,这里是:

我有一个使用Visual Studio 2013的C++项目,以及CPP Rest SDK.现在我们开始使用Qt(版本5.6),所以我在代码中添加了Qt对象.

我一直收到此错误消息:

C:\Qt\Qt5.6.0\5.6\msvc2013_64\include\QtCore/qtypetraits.h(523): warning C4003: not enough actual parameters for macro 'U'
C:\Qt\Qt5.6.0\5.6\msvc2013_64\include\QtCore/qtypetraits.h(523): warning C4003: not enough actual parameters for macro '_XPLATSTR'
C:\Qt\Qt5.6.0\5.6\msvc2013_64\include\QtCore/qtypetraits.h(523): error C2061: syntax error : identifier 'L'
          C:\Qt\Qt5.6.0\5.6\msvc2013_64\include\QtCore/qtypetraits.h(527) : see reference to class template instantiation 'QtPrivate::is_default_constructible<T>' being compiled
Run Code Online (Sandbox Code Playgroud)

Rob*_*bin 6

这不是Qt的错.这是CPP Rest SDK.它定义了一个宏 U,它U很快被替换为qtypetraits.h中的模板参数.

当我_TURN_OFF_PLATFORM_STRING在C++预处理器定义中定义时,错误消失.