c++ - why received the following error when using QT5? -


i getting following errors when build sample code using qt5, visual studio 2012 x64,

static inline qint64 nulljd() { return std::numeric_limits<qint64>::min(); }  1>c:\qt\qt5.1.1\5.1.1\msvc2012_64_opengl\include\qtcore\qdatetime.h(121): warning c4003: not enough actual parameters macro 'min'     1>c:\qt\qt5.1.1\5.1.1\msvc2012_64_opengl\include\qtcore\qdatetime.h(121): error c2589: '(' : illegal token on right side of '::'     1>c:\qt\qt5.1.1\5.1.1\msvc2012_64_opengl\include\qtcore\qdatetime.h(121): error c2059: syntax error : '::' 

how fix?

this should fix you: https://forum.qt.io/topic/21605/solved-qt5-vs2010-qdatetime-not-enough-actual-parameters-for-macro-min-max/5

the c++ min/max macro being wrong called. can set nominmax before call header solve.

there're several ways achieve that, it's being described in link sent.

i.e:

#define nominmax #include <windows.h> 

or set compiler parameter /dnominmax

or pass qmake project: defines += nominmax


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -