What type of error is this..

154 views
Skip to first unread message

zeeshan ali

unread,
Apr 9, 2012, 4:24:29 AM4/9/12
to omn...@googlegroups.com
In file included from c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/string:50:0,
                 from c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/locale_classes.h:42,
                 from c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/ios_base.h:43,
                 from c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/ios:43,
                 from c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/ostream:40,
                 from c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/iostream:40,
                 from c:/omnetpp-4.2/include/cownedobject.h:22,
                 from c:/omnetpp-4.2/include/carray.h:23,
                 from c:/omnetpp-4.2/include/omnetpp.h:21,
                 from networklayer/manetrouting/base/compatibility.h:9,
                 from networklayer/manetrouting/aodv/aodv-uu/defs_aodv.h:33,
                 from networklayer/manetrouting/aodv/aodv-uu/params.h:26,
                 from networklayer/manetrouting/aodv/aodv_uu_omnet.h:61,
                 from networklayer/manetrouting/aodv/aodv_uu_omnet.cc:27:
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_function.h: In member function 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = In_addr]':
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_tree.h:1529:38:   instantiated from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) [with _Key = In_addr, _Val = std::pair<const In_addr, unsigned char>, _KeyOfValue = std::_Select1st<std::pair<const In_addr, unsigned char> >, _Compare = std::less<In_addr>, _Alloc = std::allocator<std::pair<const In_addr, unsigned char> >, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const In_addr, unsigned char> >]'
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_map.h:737:29:   instantiated from 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = In_addr, _Tp = unsigned char, _Compare = std::less<In_addr>, _Alloc = std::allocator<std::pair<const In_addr, unsigned char> >, std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const In_addr, unsigned char> >, std::map<_Key, _Tp, _Compare, _Alloc>::key_type = In_addr]'
networklayer/manetrouting/aodv/aodv_uu_omnet.cc:350:35:   instantiated from here
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_function.h:236:22: error: no match for 'operator<' in '__x < __y'
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_function.h:236:22: note: candidates are:
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_pair.h:207:67: note: template<class _T1, class _T2> bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_iterator.h:292:46: note: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_iterator.h:342:47: note: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_IteratorL>&, const std::reverse_iterator<_IteratorR>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/basic_string.h:2511:58: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/basic_string.h:2523:27: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/basic_string.h:2535:58: note: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_vector.h:1290:77: note: template<class _Tp, class _Alloc> bool std::operator<(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_tree.h:857:70: note: template<class _Key, class _Val, class _KeyOfValue, class _Compare, class _Alloc> bool std::operator<(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_map.h:895:58: note: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const std::map<_Key, _Tp, _Compare, _Alloc>&, const std::map<_Key, _Tp, _Compare, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_multimap.h:813:63: note: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const std::multimap<_Key, _Tp, _Compare, _Alloc>&, const std::multimap<_Key, _Tp, _Compare, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_set.h:714:46: note: template<class _Key, class _Compare, class _Alloc> bool std::operator<(const std::set<_Key, _Compare, _Alloc>&, const std::set<_Key, _Compare, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_multiset.h:697:51: note: template<class _Key, class _Compare, class _Alloc> bool std::operator<(const std::multiset<_Key, _Compare, _Alloc>&, const std::multiset<_Key, _Compare, _Alloc>&)
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_list.h:1593:73: note: template<class _Tp, class _Alloc> bool std::operator<(const std::list<_Tp, _Alloc>&, const std::list<_Tp, _Alloc>&)
util/uint128.h:277:13: note: bool operator<(const Uint128&, const Uint128&)
util/uint128.h:277:13: note:   no known conversion for argument 1 from 'const In_addr' to 'const Uint128&'
make[1]: *** [../out/gcc-debug/src/networklayer/manetrouting/aodv/aodv_uu_omnet.o] Error 1
make[1]: Leaving directory `/c/omnetpp-4.2/samples/inetmanet-2.0/src'
make: *** [all] Error 2

**** Build Finished ****

Alfonso Ariza Quintana

unread,
Apr 9, 2012, 11:01:53 AM4/9/12
to omn...@googlegroups.com

I can't reproduce the problem


Date: Mon, 9 Apr 2012 01:24:29 -0700
From: zeeshu...@gmail.com
To: omn...@googlegroups.com
Subject: [Omnetpp-l] What type of error is this..
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp

Ranajoy Sarkar

unread,
Apr 10, 2012, 5:24:44 AM4/10/12
to omn...@googlegroups.com
I have declared a map in routing_table.h of aodvuu : typedef std::map<struct in_addr, u_int8_t> rt_list. I am using this to store multiple <nexthop,hopcount> for aomdv.
When I am trying to compile my code the compiler says
c:\omnetpp-4.2\mingw\bin\../lib/gcc/mingw32/4.6.1/include/c++/bits/stl_function.h:236:22: error: no match for 'operator<' in '__x < __y'
Can you please help me with this error?

Alfonso Ariza Quintana

unread,
Apr 10, 2012, 6:52:05 AM4/10/12
to omn...@googlegroups.com
struct in_addr doesn't have the operations <,> and ==, without these operations you can't use like key in a map. You can use Uint128 that is the type of data used by in_addr.s_addr type.


Date: Tue, 10 Apr 2012 02:24:44 -0700
From: rana...@gmail.com
To: omn...@googlegroups.com
Subject: Re: [Omnetpp-l] What type of error is this..

Mitra Pourhasan

unread,
Apr 10, 2012, 7:30:35 AM4/10/12
to omn...@googlegroups.com
hi
who is working with castalia?


 

Ranajoy Sarkar

unread,
Apr 11, 2012, 6:05:59 AM4/11/12
to omn...@googlegroups.com
Is there a way to overload these operators for struct in_addr. If yes then ca you tell me where I should declare this overload function. I want to add this code-
bool operator<(const struct in_addr a,const struct in_addr b) const
{
return a.s_addr<b.s_addr;
}
Will it work? Please tell me in which file I should include this code?

Ranajoy Sarkar

unread,
Apr 11, 2012, 6:35:55 AM4/11/12
to omn...@googlegroups.com
Also can you tell me where have you defined the structure struct in_addr with the parameter Uint128 s_addr

Alfonso Ariza Quintana

unread,
Apr 11, 2012, 11:14:20 AM4/11/12
to omn...@googlegroups.com

Amit Tarkar

unread,
Nov 15, 2012, 2:24:04 AM11/15/12
to omn...@googlegroups.com
networklayer/manetrouting/olsr/OLSR.cc:1495:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
networklayer/manetrouting/olsr/OLSR.cc:1526:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
networklayer/manetrouting/olsr/OLSR.cc:1532:64: error: no match for ‘operator==’ in ‘IPv4Route::getDestination() const() == aotuple->AssociationTuple::networkAddr()’
networklayer/manetrouting/olsr/OLSR.cc:1532:64: note: candidates are:
In file included from networklayer/ipv4/IPv4Datagram_m.h:17:0,
                 from networklayer/ipv4/IPv4Datagram.h:23,
                 from networklayer/manetrouting/olsr/OLSR.cc:37:
networklayer/contract/IPv4Address.h:294:10: note: bool IPv4Address::operator==(const IPv4Address&) const
networklayer/contract/IPv4Address.h:294:10: note:   no known conversion for argument 1 from ‘nsaddr_t {aka Uint128}’ to ‘const IPv4Address&’
In file included from networklayer/contract/IPv6Address.h:28:0,
                 from networklayer/contract/IPv6ControlInfo_m.h:17,
                 from networklayer/contract/IPv6ControlInfo.h:21,
                 from networklayer/manetrouting/olsr/OLSR.cc:40:
util/uint128.h:238:13: note: bool operator==(const Uint128&, const uint32_t&)
util/uint128.h:238:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:258:13: note: bool operator==(const Uint128&, const int32_t&)
util/uint128.h:258:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:248:13: note: bool operator==(const Uint128&, const uint64_t&)
util/uint128.h:248:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:268:13: note: bool operator==(const Uint128&, const int64_t&)
util/uint128.h:268:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:243:13: note: bool operator==(const uint32_t&, const Uint128&)
util/uint128.h:243:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const uint32_t& {aka const unsigned int&}’
util/uint128.h:263:13: note: bool operator==(const int32_t&, const Uint128&)
util/uint128.h:263:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const int32_t& {aka const int&}’
util/uint128.h:253:13: note: bool operator==(const uint64_t&, const Uint128&)
util/uint128.h:253:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const uint64_t& {aka const long unsigned int&}’
util/uint128.h:273:13: note: bool operator==(const int64_t&, const Uint128&)
util/uint128.h:273:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const int64_t& {aka const long int&}’
util/uint128.h:207:13: note: bool operator==(const Uint128&, const Uint128&)
util/uint128.h:207:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
networklayer/manetrouting/olsr/OLSR.cc:1533:55: error: no match for ‘operator==’ in ‘IPv4Route::getNetmask() const() == aotuple->AssociationTuple::netmask()’
networklayer/manetrouting/olsr/OLSR.cc:1533:55: note: candidates are:
In file included from networklayer/ipv4/IPv4Datagram_m.h:17:0,
                 from networklayer/ipv4/IPv4Datagram.h:23,
                 from networklayer/manetrouting/olsr/OLSR.cc:37:
networklayer/contract/IPv4Address.h:294:10: note: bool IPv4Address::operator==(const IPv4Address&) const
networklayer/contract/IPv4Address.h:294:10: note:   no known conversion for argument 1 from ‘nsaddr_t {aka Uint128}’ to ‘const IPv4Address&’
In file included from networklayer/contract/IPv6Address.h:28:0,
                 from networklayer/contract/IPv6ControlInfo_m.h:17,
                 from networklayer/contract/IPv6ControlInfo.h:21,
                 from networklayer/manetrouting/olsr/OLSR.cc:40:
util/uint128.h:238:13: note: bool operator==(const Uint128&, const uint32_t&)
util/uint128.h:238:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:258:13: note: bool operator==(const Uint128&, const int32_t&)
util/uint128.h:258:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:248:13: note: bool operator==(const Uint128&, const uint64_t&)
util/uint128.h:248:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:268:13: note: bool operator==(const Uint128&, const int64_t&)
util/uint128.h:268:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
util/uint128.h:243:13: note: bool operator==(const uint32_t&, const Uint128&)
util/uint128.h:243:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const uint32_t& {aka const unsigned int&}’
util/uint128.h:263:13: note: bool operator==(const int32_t&, const Uint128&)
util/uint128.h:263:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const int32_t& {aka const int&}’
util/uint128.h:253:13: note: bool operator==(const uint64_t&, const Uint128&)
util/uint128.h:253:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const uint64_t& {aka const long unsigned int&}’
util/uint128.h:273:13: note: bool operator==(const int64_t&, const Uint128&)
util/uint128.h:273:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const int64_t& {aka const long int&}’
util/uint128.h:207:13: note: bool operator==(const Uint128&, const Uint128&)
util/uint128.h:207:13: note:   no known conversion for argument 1 from ‘IPv4Address’ to ‘const Uint128&’
networklayer/manetrouting/olsr/OLSR.cc:1539:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
networklayer/manetrouting/olsr/OLSR.cc:1586:1: error: a function-definition is not allowed here before ‘{’ token
networklayer/manetrouting/olsr/OLSR.cc:1608:1: error: a function-definition is not allowed here before ‘{’ token
networklayer/manetrouting/olsr/OLSR.cc:3265:1: error: expected ‘}’ at end of input
make: *** [../out/gcc-debug/src/networklayer/manetrouting/olsr/OLSR.o] Error 1

alfonso ariza

unread,
Nov 15, 2012, 6:49:23 AM11/15/12
to omn...@googlegroups.com

I suspect  that you have the code outdate

--

Reply all
Reply to author
Forward
0 new messages