|
Boost Users : |
Subject: [Boost-users] boost bind conflicting with socket bind
From: Sharad Mittal (sharadmittal_at_[hidden])
Date: 2008-10-29 14:35:41
Hello,
My Socket code that contains call to "bind" to a port is conflicting with boost::bind in 1.36. It compiles fine under boost 1.34 and 1.35. Interestingly, nothing is included from boost in that file. I am using boost with mingw on Win Xp.
The code snippet is as follows:
int Socket::BindPort(int family, int address, int port) {
sockaddr_in sa;
int dwError = RERROR_SUCCESS;
memset(&sa, 0, sizeof(sa));
sa.sin_family = family;
sa.sin_addr.s_addr = address;
sa.sin_port = htons(port);
if (bind(s_, (sockaddr *)&sa, sizeof(sockaddr_in)) == SOCKET_ERROR) {
dwError = RERROR_SOCKET_BIND_ERROR;
LOG (LOG_ERR, "Could not bind socket to port %u", port);
BAIL_ON_ERROR (dwError);
}
error:
return dwError;
}
Here is what I am getting...
[g++] [Socket.o]<-[Socket.cpp]
E:/msys/1.0/boost/boost_1_36_0/boost/bind.hpp: In instantiation of `boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>':
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:15: instantiated from `boost::_bi::bind_t<boost::_bi::unspecified, unsigned int, boost::_bi::list2<boost::_bi::value<sockaddr*>, boost::_bi::value<unsigned int> > >'
Socket.cpp:98: instantiated from here
E:/msys/1.0/boost/boost_1_36_0/boost/bind.hpp:67: error: `unsigned int' is not a class, struct, or union type
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp: In instantiation of `boost::_bi::bind_t<boost::_bi::unspecified, unsigned int, boost::_bi::list2<boost::_bi::value<sockaddr*>, boost::_bi::value<unsigned int> > >':
Socket.cpp:98: instantiated from here
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:15: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:18: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:24: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:30: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:36: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:45: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:51: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:59: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:65: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:74: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:80: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:87: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
E:/msys/1.0/boost/boost_1_36_0/boost/bind/bind_template.hpp:93: error: no type named `type' in `struct boost::_bi::result_traits<boost::_bi::unspecified, unsigned int>'
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net