< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate-users] Hello! I Have compile problem


Hi Sergey,

As best I can tell from your error message, your platform is considering NULL to be an int rather than a pointer, and the implicit casting to pointer is failing.

Can you try changing rutil/dns/AresDns.cxx line 345 from:
         mPollItems.insert( mPollItems.end(), (*channel)->nservers, NULL);
to:
         mPollItems.insert( mPollItems.end(), (*channel)->nservers, ((AresDnsPollItem*)0));
And let me know if that makes your compiler happy.

All,
What is most portable C++ convention for NULL pointers?
              NULL
              0
              ((type*)0)
              ((type*)NULL)
              static_cast<type*>NULL

I've always used the first form without issues, but seems like that doesn't work everywhere.

Thanks,
Kennard


On Mon, Jan 31, 2011 at 10:18 AM, Sergey Pachkov <Sergey.Pachkov@xxxxxxxxxxx> wrote:
I downloaded latest sources from svn
for sipXtapi and reSIProcate

and I tried to compile sources on rhel6.i686 with gcc.4.4

on rutil directory compiler returns errors like this

make[1]: Entering directory `/home/rusepa/reSIProcate/reSIProcate/rutil'

stl_vector.h: In member function ‘void std::vector<_Tp,
_Alloc>::_M_insert_dispatch(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, _Integer, _Integer, std::__true_type) [with _Integer = int, _Tp =
resip::AresDnsPollItem*, _Alloc = std::allocator<resip::AresDnsPollItem*>]’:

stl_vector.h:874:   instantiated from ‘void std::vector<_Tp,
_Alloc>::insert(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp,
_Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, _InputIterator,
_InputIterator) [with _InputIterator = int, _Tp = resip::AresDnsPollItem*,
_Alloc = std::allocator<resip::AresDnsPollItem*>]’

dns/AresDns.cxx:345:   instantiated from here
stl_vector.h:1092: error: invalid conversion from 'int' to
'resip::AresDnsPollItem*'

stl_vector.h:1092: error:   initializing argument 3 of  ‘void std::vector<_Tp,
_Alloc>::_M_fill_insert(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp,
_Alloc> >, size_t, const _Tp&) [with _Tp = resip::AresDnsPollItem*, _Alloc =
std::allocator<resip::AresDnsPollItem*>]’


Is there any quick fix of this problem?

svn revision is 8999
https://svn.resiprocate.org/rep/resiprocate/main
_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/