Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Qt5 + VS2010 QDateTime => not enough actual parameters for macro 'min' & 'max'
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt5 + VS2010 QDateTime => not enough actual parameters for macro 'min' & 'max'

Scheduled Pinned Locked Moved General and Desktop
21 Posts 12 Posters 41.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    djszapi
    wrote on last edited by
    #11

    MaximAlien: have you tried "/DNOMINMAX"?

    or DEFINES += NOMINMAX with qmake?

    1 Reply Last reply
    1
    • M Offline
      M Offline
      MaximAlien
      wrote on last edited by
      #12

      Thanks for help Laszlo! Defining @DEFINES += NOMINMAX@ in pro file helped me.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sdolard
        wrote on last edited by
        #13

        Use this include "#include <*qt_*windows.h>" instead of #include <windows.h>

        1 Reply Last reply
        0
        • D Offline
          D Offline
          djszapi
          wrote on last edited by
          #14

          @sdolard: that will not ultimately help.

          Also, not sure what you mean by stars in there.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sdolard
            wrote on last edited by
            #15

            @Laszlo Papp
            Sure, but qt_windows.h already include a define for NOMINMAX, and other stuffs. So it's better to use it.

            Chars between * should be bolded.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              djszapi
              wrote on last edited by
              #16

              sdolard: the problem is that, it does more than what you need, so not compact enough. :)

              More importantly, you need to find and maintain the right place for the include. If you do it in the build system, it always works.

              Also, even though qt_windows.h is installed publicly, you could include anytime. However, if you wanna be nice, you would use qt win ifdefs around just in case, but then it is getting uglier. :)

              But yes, provided those drawbacks are not real problems, that also works.

              1 Reply Last reply
              0
              • X Offline
                X Offline
                XGuy
                wrote on last edited by
                #17

                [quote author="AcerExtensa" date="1355825116"]#define NOMINMAX before including windows.h header. This is only way at the moment...[/quote]

                Hi
                i had the same problem and got it working by following your suggestion.
                thx.

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  frankiefrank
                  wrote on last edited by
                  #18

                  This thread helped me out with this issue. THANK YOU.

                  "Roads? Where we're going, we don't need roads."

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DimitriJunker
                    wrote on last edited by
                    #19

                    Hi,

                    I have the same problem, but without an include of windows.h. So I can not enter a define before it and including
                    DEFINES += NOMINMAX
                    in the pro-file did'nt worked either.
                    Any more ideas?

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      DimitriJunker
                      wrote on last edited by
                      #20

                      Hi,

                      since I started the project I had to reinstall windows and so qt creator. Originaly i used mingw. Now I also installed mingw, but somehow the installation was not compleat and qt creator used msvc instead. After swiching back to mingw I got rid of the error. So it's solved for me, but others might have the same problem.

                      Dimitri

                      1 Reply Last reply
                      0
                      • A AcerExtensa

                        #define NOMINMAX before including windows.h header. This is only way at the moment...

                        N Offline
                        N Offline
                        Nadun
                        wrote on last edited by
                        #21

                        @AcerExtensa said:

                        #define NOMINMAX before including windows.h header. This is only way at the moment...

                        This worked to me for Qt5.5 VS2010

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved