Error: Ambiguos overload for 'operator<' Qt5.3



  • Hello to every one.
    I'm using Qt 5.3 and after the compilation of my project i got this error:

    /usr/include/c++/4.8/bits/stl_function.h:235: error: ambiguous overload for 'operator<' (operand types are 'const QVariant' and 'const QVariant')
    { return __x < __y; }
    ^

    Note that I have been compiled the same project with Qt 4.x and I've got no problems. I have this error only with Qt 5.x
    Someone can help me to understand why this happens?

    Thank you for your support...


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you provide the complete error log ?



  • Thanks for the fast reply...this is the complete compile output:

    @g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DISABLE_DEPRECATED_BEFORE=0x000000 -DADE_HTTPS_LIBRARY -DDEBUG=1 -DQT_SCRIPT_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I/home/user/Qt/5.3/gcc/mkspecs/linux-g++ -I. -I../../../src/cpp -I/home/user/Qt/5.3/gcc/include -I/home/user/Qt/5.3/gcc/include/QtScript -I/home/user/Qt/5.3/gcc/include/QtNetwork -I/home/user/Qt/5.3/gcc/include/QtXml -I/home/user/Qt/5.3/gcc/include/QtSql -I/home/user/Qt/5.3/gcc/include/QtCore -Imoc -o obj/site_manager.o ../../../src/cpp/ADE/https/site_manager.cpp
    In file included from /usr/include/c++/4.8/string:48:0,
    from /home/user/Qt/5.3/gcc/include/QtCore/qstring.h:50,
    from /home/user/Qt/5.3/gcc/include/QtCore/QString:1,
    from ../../../src/cpp/ADE/exceptions/exceptions.h:36,
    from ../../../src/cpp/ADE/https/xml/attributes.h:5,
    from ../../../src/cpp/ADE/https/session.cpp:27:
    /usr/include/c++/4.8/bits/stl_function.h: In instantiation of 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = QVariant]':
    /usr/include/c++/4.8/bits/stl_tree.h:1794:8: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) [with _Key = QVariant; _Val = std::pair<const QVariant, ADE::DB::LockManager::Lock::type>; _KeyOfValue = std::_Select1st<std::pair<const QVariant, ADE::DB::LockManager::Lock::type> >; _Compare = std::less<QVariant>; _Alloc = std::allocator<std::pair<const QVariant, ADE::DB::LockManager::Lock::type> >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const QVariant, ADE::DB::LockManager::Lock::type> >]'
    /usr/include/c++/4.8/bits/stl_map.h:822:29: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = QVariant; _Tp = ADE::DB::LockManager::Lock::type; _Compare = std::less<QVariant>; _Alloc = std::allocator<std::pair<const QVariant, ADE::DB::LockManager::Lock::type> >; std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const QVariant, ADE::DB::LockManager::Lock::type> >; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = QVariant]'
    ../../../src/cpp/ADE/std/map.hpp:139:53: required from 'void ADE::Std::Ctr::Map<K, T>::erase(const K&, const ADE::Exception::NoData&) [with K = QVariant; T = ADE::DB::LockManager::Lock::type]'
    ../../../src/cpp/ADE/https/session.cpp:252:1: required from here
    /usr/include/c++/4.8/bits/stl_function.h:235:20: error: ambiguous overload for 'operator<' (operand types are 'const QVariant' and 'const QVariant')
    { return __x < __y; }
    ^
    /usr/include/c++/4.8/bits/stl_function.h:235:20: note: candidates are:
    In file included from /home/user/Qt/5.3/gcc/include/QtCore/QVariant:1:0,
    from ../../../src/cpp/ADE/db/global.h:36,
    from ../../../src/cpp/ADE/db/statements_base.h:35,
    from ../../../src/cpp/ADE/db/statements_select.h:35,
    from ../../../src/cpp/ADE/https/xml/attributes.h:6,
    from ../../../src/cpp/ADE/https/session.cpp:27:
    /home/user/Qt/5.3/gcc/include/QtCore/qvariant.h:436:17: note: bool QVariant::operator<(const QVariant&) const
    inline bool operator<(const QVariant &v) const
    ^
    In file included from ../../../src/cpp/ADE/std/common.hpp:33:0,
    from ../../../src/cpp/ADE/std/map.h:43,
    from ../../../src/cpp/ADE/std/map.hpp:33,
    from ../../../src/cpp/ADE/db/global.h:38,
    from ../../../src/cpp/ADE/db/statements_base.h:35,
    from ../../../src/cpp/ADE/db/statements_select.h:35,
    from ../../../src/cpp/ADE/https/xml/attributes.h:6,
    from ../../../src/cpp/ADE/https/session.cpp:27:
    ../../../src/cpp/ADE/std/common.h:128:14: note: bool operator<(const QVariant&, const QVariant&)
    ADE_STD bool operator<( const QVariant & a, const QVariant & b );
    ^
    g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DISABLE_DEPRECATED_BEFORE=0x000000 -DADE_HTTPS_LIBRARY -DDEBUG=1 -DQT_SCRIPT_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I/home/user/Qt/5.3/gcc/mkspecs/linux-g++ -I. -I../../../src/cpp -I/home/user/Qt/5.3/gcc/include -I/home/user/Qt/5.3/gcc/include/QtScript -I/home/user/Qt/5.3/gcc/include/QtNetwork -I/home/user/Qt/5.3/gcc/include/QtXml -I/home/user/Qt/5.3/gcc/include/QtSql -I/home/user/Qt/5.3/gcc/include/QtCore -Imoc -o obj/lambda_todo_iter.o ../../../src/cpp/ADE/https/modules/lambda_todo_iter.cpp
    make[1]: *** [obj/session.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory `/home/user/Scrivania/Local_ADE/ade/trunk/lib/ade_https/ade_https'
    make: *** [sub-ade_https-make_first-ordered] Error 2
    13:48:34: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project lib (kit: Desktop Qt 5.3 GCC 32bit)
    When executing step "Make"
    13:48:34: Elapsed time: 03:47.@


Log in to reply
 

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