Strange errors when compiling Qt - please help urgent



  • I suddenly started getting some strange errors while compiling the code.
    i have not modified any files from these locations.

    for a while it was working perfect, and i observed these suddenly, i could not rectify the problem.
    now even if i open a new project and write @qDebug() <<"hello";@ also it is giving these errors.
    i cut few lines because of no of lines constraint .

    @
    In file included from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qhash.h:50:0,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qdebug.h:46,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/QDebug:1,
    from mainwindow.cpp:2:
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:9:7: error: redefinition of ‘class QTypeInfo<T>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2084:1: error: previous definition of ‘class QTypeInfo<T>’
    In file included from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qhash.h:50:0,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qdebug.h:46,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/QDebug:1,
    from mainwindow.cpp:2:
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:62:1: error: redefinition of ‘class QTypeInfo<bool>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2206:1: error: previous definition of ‘class QTypeInfo<bool>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:63:1: error: redefinition of ‘class QTypeInfo<char>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2207:1: error: previous definition of ‘class QTypeInfo<char>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:64:1: error: redefinition of ‘class QTypeInfo<signed char>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2208:1: error: previous definition of ‘class QTypeInfo<signed char>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:65:1: error: redefinition of ‘class QTypeInfo<unsigned char>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2209:1: error: previous definition of ‘class QTypeInfo<unsigned char>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:66:1: error: redefinition of ‘class QTypeInfo<short int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2210:1: error: previous definition of ‘class QTypeInfo<short int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:67:1: error: redefinition of ‘class QTypeInfo<short unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2211:1: error: previous definition of ‘class QTypeInfo<short unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:68:1: error: redefinition of ‘class QTypeInfo<int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2212:1: error: previous definition of ‘class QTypeInfo<int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:69:1: error: redefinition of ‘class QTypeInfo<unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2213:1: error: previous definition of ‘class QTypeInfo<unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:70:1: error: redefinition of ‘class QTypeInfo<long int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2214:1: error: previous definition of ‘class QTypeInfo<long int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:71:1: error: redefinition of ‘class QTypeInfo<long unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2215:1: error: previous definition of ‘class QTypeInfo<long unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:72:1: error: redefinition of ‘class QTypeInfo<long long int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2216:1: error: previous definition of ‘class QTypeInfo<long long int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:73:1: error: redefinition of ‘class QTypeInfo<long long unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2217:1: error: previous definition of ‘class QTypeInfo<long long unsigned int>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qtypeinfo.h:74:1: error: redefinition of ‘class QTypeInfo<float>’
    /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qglobal.h:2218:1: error: previous definition of ‘class QTypeInfo<float>’

    make: *** [mainwindow.o] Error 1@



  • continuation of errors

    @
    In file included from /usr/include/c++/4.5/map:60:0,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qmap.h:50,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/qdebug.h:48,
    from /usr/local/Trolltech/Qt-4.8.0/include/QtCore/QDebug:1,
    from mainwindow.cpp:2:
    /usr/include/c++/4.5/bits/stl_tree.h:334:35: error: declaration of ‘typedef struct std::_Rb_tree_node<_Val> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Rb_tree_node’
    /usr/include/c++/4.5/bits/stl_tree.h:133:5: error: changes meaning of ‘_Rb_tree_node’ from ‘struct std::_Rb_tree_node<_Val>’
    /usr/include/c++/4.5/bits/stl_tree.h:395:40: error: expected unqualified-id before ‘__is_pod’
    /usr/include/c++/4.5/bits/stl_tree.h:395:40: error: expected ‘>’ before ‘__is_pod’
    /usr/include/c++/4.5/bits/stl_tree.h:433:29: error: template argument 2 is invalid
    /usr/include/c++/4.5/bits/stl_tree.h: In copy constructor ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Rb_tree(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)’:
    /usr/include/c++/4.5/bits/stl_tree.h:565:14: error: request for member ‘_M_node_count’ in ‘((std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>)this)->std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_impl’, which is of non-class type ‘int’
    /usr/include/c++/4.5/bits/stl_tree.h: In member function ‘_Compare std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_comp() const’:
    /usr/include/c++/4.5/bits/stl_tree.h:578:24: error: request for member ‘_M_key_compare’ in ‘((const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>
    )this)->std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_impl’, which is of non-class type ‘const int’
    /usr/include/c++/4.5/bits/stl_tree.h: In member function ‘bool std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::empty() const’:
    /usr/include/c++/4.5/bits/stl_tree.h:617:24: error: request for member ‘_M_node_count’ in ‘((const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>*)this)->std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_impl’, which is of non-class type ‘const int’
    /usr/include/c++/4.5/bits/stl_tree.h: In member function ‘std::_Rb_tree::size_t
    @



  • got it resolved !
    some james bond removed/added some files from include folder causing it to throw these error.


Log in to reply
 

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