2016-05-13 66 views
3

「L」現在這已經花費了相當長一段時間,所以in case任何人有這個問題,那就是:C2061:語法錯誤:標識符qtypetraits.h

我使用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 

回答

6

這不是Qt的錯。這是CPP Rest SDK。它defines a macroU,它很高興地替換爲qtypetraits.h中的U模板參數。

當我在C++預處理器定義中定義_TURN_OFF_PLATFORM_STRING時,錯誤消失。

相關問題