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. INTMAX_MAX undefined?
QtWS25 Last Chance

INTMAX_MAX undefined?

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 5 Posters 7.4k Views
  • 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
    davecotter
    wrote on last edited by
    #6

    i hacked around it by just defining it myself, but the further errors are like this:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\chrono(569): warning C4002: too many arguments for function-like macro invocation 'round'
    

    is this about the compiler? i've been stumped for days on this

    jsulmJ 1 Reply Last reply
    0
    • D davecotter

      i hacked around it by just defining it myself, but the further errors are like this:

      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\chrono(569): warning C4002: too many arguments for function-like macro invocation 'round'
      

      is this about the compiler? i've been stumped for days on this

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #7

      @davecotter said in INTMAX_MAX undefined?:

      round

      Are you calling this? If so can you show how?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #8

        the file "chrono" (which is part of MSVC) is calling it. below on the line that starts "_NODISCARD"

        template<class _To,
        	class _Rep,
        	class _Period,
        	class = enable_if_t<_Is_duration_v<_To>
        		&& !treat_as_floating_point_v<typename _To::rep>>>
        	_NODISCARD constexpr _To round(const duration<_Rep, _Period>& _Dur)
        	{	// convert duration to another duration, round to nearest, ties to even
        	const _To _Floored{chrono::floor<_To>(_Dur)};
        	const _To _Ceiled{_Floored + _To{1}};
        	const auto _Floor_adjustment = _Dur - _Floored;
        	const auto _Ceil_adjustment = _Ceiled - _Dur;
        	if (_Floor_adjustment < _Ceil_adjustment
        		|| (_Floor_adjustment == _Ceil_adjustment && _Is_even(_Floored.count())))
        		{
        		return (_Floored);
        		}
        
        	return (_Ceiled);
        	}
        
        1 Reply Last reply
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by davecotter
          #9

          i will PAY someone $100 per hour to help me fix this (assuming it gets fixed, ie: $0 if it doesn't get fixed). minimum pay $100 even if it takes you 5 minutes to fix. assuming we'll get on the fone and do screen sharing.

          Job Posting on UpWork

          1 Reply Last reply
          0
          • VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by VRonin
            #10

            [I'm not interested in a fee]
            Can you provide a minimum example to reproduce the problem?

            Did you try adding the __STDC_LIMIT_MACROS definition as suggested above?
            In Qt Creator you can add DEFINES += __STDC_LIMIT_MACROS to your pro file and re-run qmake

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            1 Reply Last reply
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by davecotter
              #11

              no, this is a monolithic application with a required dependency on CFLite (apple's CoreFoundation). it worked before upgrading Qt to the latest. best is to do a screen share so you can just poke directly at the project

              yes i did that with the define thing, to no avail. the latest stdint auto-defines that when including from a C++ file anyway.

              VRoninV 1 Reply Last reply
              0
              • D davecotter

                no, this is a monolithic application with a required dependency on CFLite (apple's CoreFoundation). it worked before upgrading Qt to the latest. best is to do a screen share so you can just poke directly at the project

                yes i did that with the define thing, to no avail. the latest stdint auto-defines that when including from a C++ file anyway.

                VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by VRonin
                #12

                @davecotter said in INTMAX_MAX undefined?:

                it worked before upgrading Qt to the latest

                From what version were you upgrading from? chrono was added in Qt 5.9

                What update version of MSVC 2017 are you using?

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  davecotter
                  wrote on last edited by
                  #13

                  worked in 5.9.1 and in 5.10.0. now on 5.11.1 which fails

                  1 Reply Last reply
                  0
                  • VRoninV Offline
                    VRoninV Offline
                    VRonin
                    wrote on last edited by VRonin
                    #14

                    @VRonin said in INTMAX_MAX undefined?:

                    What update version of MSVC 2017 are you using?

                    Did you update MSVC as well when moving to Qt 5.11.1?

                    Can you update to 5.11.2? (I don't think it will fix the issue but worth the try)

                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                    ~Napoleon Bonaparte

                    On a crusade to banish setIndexWidget() from the holy land of Qt

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #15

                      In addition to what @VRonin wrote, can you also show the code that triggers that error ?
                      Can you trigger it with a minimal application ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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

                        can you also show the code that triggers that error ?

                        scroll up to my previous reply which starts: <<the file "chrono">>

                        Can you trigger it with a minimal application ?

                        no, this is a monolithic application with a required dependency on CFLite

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #17

                          It was not completely clear whether including std::chrono's was enough to trigger that or if you had some specific part of your code using it that would be.

                          We understood that you have a monolithic application. The question is; can you start from one of Qt's default project and use std's chrono in there to check whether it's working at all. If it is, then add CFLite, etc.

                          As for why Clang on Windows, Clang is used for the code model.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            davecotter
                            wrote on last edited by
                            #18

                            i've updated to the latest MSDEV 2017 (community) and the latest Qt SDK (5.11.2), doesn't help.

                            QMenu.h ends up including chrono, so, yes, default Qt apps (that have menus) definitely work with chrono / ratio (the file <ratio> is where the problem is revealed). Adding CFLite is actually a lot of work. :( I realize it's a fair test to ask for, but i'm hoping to avoid taking the time to make that test? i'm trying more things first...

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

                              minimal project posted here

                              note this assumes you have python 2.7 installed. you can get the installer here.

                              after you download the zip file above, and expand, go here:
                              .../CFTest/project/qt/CFTest/CFTest_win.pro
                              open that

                              configure as seen in the screen shots below. the full line for cftest run exec is this:

                              %{sourceDir}..\build\win_64_%{CurrentBuild:Type}%{CurrentBuild:Name}.app\Contents\Windows%{CurrentBuild:Name}.exe
                              

                              0_1540578058507_cflite - build.png
                              0_1540578069563_cftest - build.png
                              0_1540578072109_cftest - run.png
                              0_1540578074762_cftest - dependencies.png

                              1 Reply Last reply
                              0
                              • innermousI Offline
                                innermousI Offline
                                innermous
                                wrote on last edited by
                                #20

                                Did you succeed with it so far?

                                1 Reply Last reply
                                0
                                • D Offline
                                  D Offline
                                  davecotter
                                  wrote on last edited by
                                  #21

                                  @VRonin made the correct suggestion, to define this:

                                  __STDC_LIMIT_MACROS
                                  

                                  The other problem was that i had defined "round()" as a macro somewhere else

                                  Thanks everyone!

                                  1 Reply Last reply
                                  2

                                  • Login

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