Results 1 to 2 of 2

Thread: QT5 Error : macro “min” requires 2 arguments, but only 1 given

  1. #1
    Join Date
    Mar 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QT5 Error : macro “min” requires 2 arguments, but only 1 given

    Here is a part of compiled output :

    C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/limits:1708:7: error: expected ';' at end of member declaration
    min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
    ^ In file included from C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/cstddef:44:0,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/qglobal.h:39,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/qatomic.h:34,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/qvariant.h:37,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/QVariant:1,
    from ..\qIMS_bb1/ui_admingui.h:13,
    from ..\qIMS_bb1\admingui.h:3,
    from ..\qIMS_bb1\admingui.cpp:1: C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/limits:1708:13:
    error: expected unqualified-id before 'throw'
    min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
    ^ In file included from ..\..\..\..\Qt\5.5\mingw492_32\include\QtCore/qdatetime.h:41:0,
    from ..\..\..\..\Qt\5.5\mingw492_32\include\QtCore/QTime:1,
    from ..\qIMS_bb1\DeviceControl.h:14,
    from ..\qIMS_bb1\mainapp.h:12,
    from ..\qIMS_bb1\admingui.h:4,
    from ..\qIMS_bb1\admingui.cpp:1: C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/limits:1711:7:
    error: expected ';' at end of member declaration
    max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
    ^ In file included from C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/cstddef:44:0,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/qglobal.h:39,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/qatomic.h:34,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/qvariant.h:37,
    from ..\..\..\..\Qt\5.5\mingw492_32\include/QtCore/QVariant:1,
    from ..\qIMS_bb1/ui_admingui.h:13,
    from ..\qIMS_bb1\admingui.h:3,
    from ..\qIMS_bb1\admingui.cpp:1: C:/Qt/Tools/mingw492_32/i686-w64-mingw32/include/c++/limits:1711:13:
    error: expected unqualified-id before 'throw'
    max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
    ^ In file included from ..\..\..\..\Qt\5.5\mingw492_32\include\QtCore/QTime:1:0,
    from ..\qIMS_bb1\DeviceControl.h:14,
    from ..\qIMS_bb1\mainapp.h:12,
    from ..\qIMS_bb1\admingui.h:4,
    from ..\qIMS_bb1\admingui.cpp:1: ..\..\..\..\Qt\5.5\mingw492_32\include\QtCore/qdatetime.h: In static member function 'static qint64 QDate::nullJd()': ..\..\..\..\Qt\5.5\mingw492_32\include\QtCore/qdatetime.h:124:96:
    error: 'std::numeric_limits<long long int>::min' cannot be used as a function
    static Q_DECL_CONSTEXPR inline qint64 nullJd() { return (std::numeric_limits<qint64>::min)(); }
    ^
    Makefile.Debug:4813: recipe for target 'debug/admingui.o' failed
    mingw32-make[1]: *** [debug/admingui.o] Error 1 mingw32-make[1]:
    Leaving directory 'C:/Users/KapoorK/Desktop/build-qIMS_bb-Desktop_Qt_5_5_1_MinGW_32bit-Debug'
    makefile:34: recipe for target 'debug' failed mingw32-make: ***
    [debug] Error 2 16:08:21: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project qIMS_bb (kit: Desktop Qt 5.5.1 MinGW 32bit) When executing step "Make" 16:08:21: Elapsed time: 00:19.


    Would appreciate any help.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,321
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT5 Error : macro “min” requires 2 arguments, but only 1 given

    Seems sort of obvious if you read the error messages. One of your project's header files (probably DeviceControl.h) is pulling in an incorrect header file. Looks like it is pulling in <limits> when it should be pulling in a header where min() and max() are defined as macros.

Similar Threads

  1. Project ERROR: This mkspec requires an MSYS environment
    By Er.Dhananjay in forum Installation and Deployment
    Replies: 1
    Last Post: 26th May 2020, 23:33
  2. Replies: 0
    Last Post: 28th October 2014, 17:16
  3. Replies: 6
    Last Post: 25th January 2014, 10:12
  4. QT_MODULE() macro error?
    By batileon in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2009, 04:43
  5. QProcess error Using Arguments Qt 4.5
    By xanders in forum Qt Programming
    Replies: 6
    Last Post: 15th May 2009, 15:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.