Re: Problem compiling IPERF 1.1.1 on Red Hat 9.0
> >Hi,
> >I get the following error when trying to compile (make) IPERF v. 1.1.1 on
> Red Hat 9.0 version of Linux. IPERF 1.7.0 compiles and installs ok but I
> need to use
> >version 1.1.1. Thank you for your help with this!!! Here is the error:
> >
> >c++ -I../lib -I../cfg -Wall -O2 -DHAVE_CONFIG_H -c PerfSocket_UDP.cpp
> >PerfSocket_UDP.cpp: In member function `void
> > PerfSocket::Multicast_remove_client(sockaddr_in)':
> >PerfSocket_UDP.cpp:404: no matching function for call to `
> > std::vector<sockaddr_in, std::allocator<sockaddr_in>
> >::erase(sockaddr_in*)'
> >/usr/include/c++/3.2.2/bits/stl_vector.h:647: candidates are:
> > __gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >
> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<_Tp*,
> > std::vector<_Tp, _Alloc> >) [with _Tp = sockaddr_in, _Alloc =
> > std::allocator<sockaddr_in>]
> >/usr/include/c++/3.2.2/bits/stl_vector.h:670:
> > __gnu_cxx::__normal_iterator<_Tp*, std::vector<_Tp, _Alloc> >
> > std::vector<_Tp, _Alloc>::erase(__gnu_cxx::__normal_iterator<_Tp*,
> > std::vector<_Tp, _Alloc> >, __gnu_cxx::__normal_iterator<_Tp*,
> > std::vector<_Tp, _Alloc> >) [with _Tp = sockaddr_in, _Alloc =
> > std::allocator<sockaddr_in>]
> >make[1]: *** [PerfSocket_UDP.o] Error 1
> >make[1]: Leaving directory `/home/dlt/pkg/iperf-1.2/src'
> >make: *** [iperf] Error 2
> >
> >Thanks again for the help!
> >Mark
Mark,
I think you are using version 1.2, as version 1.1 doesn't use vectors and
there is no line 404.
We actually do not have the 1.2 source on the web anymore as 1.7 is the
most current version. What is preventing you from using 1.2?
If you want to fix it.. change the entire function to the following:
void PerfSocket::Multicast_remove_client(sockaddr_in peer) {
extern vector<sockaddr_in> clients;
for(vector<sockaddr_in>::iterator i = clients.begin(), e =
clients.end(); i < e; ++i)
{
sockaddr_in t1 = *i;
if ( ((long) t1.sin_addr.s_addr == (long) peer.sin_addr.s_addr)
&& ( t1.sin_port == peer.sin_port)) {
(clients).erase(i);
return;
}
}
return;
}
Let me know if you still have problems.
Thanks,
Tanya Brethour
DAST