这已经花费了我很多时间,所以 in case其他人有这个问题,这里是:
我有一个使用 Visual Studio 2013 和 CPP Rest SDK 的 C++ 项目。现在我们开始使用 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
最佳答案
这不是 Qt 的错。这是 CPP Rest SDK。它defines a macro U
,在 qtypetraits.h 中被替换为 U
模板参数。
当我在 C++ 预处理器定义中定义 _TURN_OFF_PLATFORM_STRING
时,错误消失了。
关于c++ - C2061 : syntax error : identifier 'L' in qtypetraits.小时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37206167/