C2589: '(' : illegal token on right side of '::'



  • Hello,

    I have encountered the same problem found here, and tried all of the recommended solutions:
    http://qt-project.org/forums/viewthread/22133

    qdatetime.h gives a syntax error at the line:
    static inline qint64 nullJd() { return std::numeric_limits<qint64>::min(); }

    The error is:
    C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\include\QtCore\qdatetime.h:122: error: C2589: '(' : illegal token on right side of '::'

    I have windows.h declared in a header file (which is probably a bad idea), but have included before it:
    #define NOMINMAX #include <limits>

    Also in the .pro file I have included DEFINES += NOMINMAX

    For some reason this error still persists. Any ideas?

    Thanks!



  • Did you define NOMINMAX before windows.h ?

    @
    #define NOMINMAX
    #include <windows.h>
    @



  • take a look on "this":http://stackoverflow.com/a/2561377

    try to undef min and max before using min and max from the <limits>


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.