Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31469

Failed to build application that uses QDateTime class with Visual C++ 11.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.0.2
    • Core: Date/Time
    • None
    • 1. Visual Studio Ultimate 2012 Update 2.
      2. Qt 5.0.2 built from sources as shared library.
      3. Qt Add-in 1.2.1

    Description

      Failed to build application that uses QDateTime class with Visual C++ 11.0 due to absence of macro NOMINMAX (Windows specific):

      1>d:\users\marat\documents\work\cpp\qt_5_0_2_msvc2012_shared\qtbase\include\qtcore\../../src/corelib/tools/qdatetime.h(123): warning C4003: not enough actual parameters for macro 'min'
      1>d:\users\marat\documents\work\cpp\qt_5_0_2_msvc2012_shared\qtbase\include\qtcore\../../src/corelib/tools/qdatetime.h(123): error C2589: '(' : illegal token on right side of '::'
      1>d:\users\marat\documents\work\cpp\qt_5_0_2_msvc2012_shared\qtbase\include\qtcore\../../src/corelib/tools/qdatetime.h(123): error C2059: syntax error : '::'
      

      If Qt needs NOMINMAX to be defined for building itself - that's ok. But I think that Qt shouldn't require this macro definition from users of Qt. Solution is very simple - make public headers of Qt independent of NOMINMAX (see qdatetime.h.patch).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              thiago Thiago Macieira
              mabrarov Marat Abrarov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes