Compiler's telling me a Boost class isn't a class.

Hi all. Just started using Boost, and these three lines (which compile in another project) fail here: // Get a list of endpoints corresponding to the server name. tcp::resolver theResolver(boost::asio::io_service); tcp::resolver::query query("10.10.10.10", "http"); tcp::resolver::iterator endpoint_iterator = theResolver.resolve(query); The compiler gripes thus: error: request for member 'resolve' in 'theResolver', which is of non-class type 'boost::asio::ip::basic_resolver<boost::asio::ip::tcp, boost::asio::ip::resolver_service<boost::asio::ip::tcp> > ()(boost::asio::io_service)' "using boost::asio::ip::tcp;" appears in an earlier included file. I don't see why this would work elsewhere and not here. Anybody have a guess as to what the problem is? Thanks!

AMDG G S wrote:
Just started using Boost, and these three lines (which compile in another project) fail here:
// Get a list of endpoints corresponding to the server name. tcp::resolver theResolver(boost::asio::io_service);
This is a function declaration.
tcp::resolver::query query("10.10.10.10", "http"); tcp::resolver::iterator endpoint_iterator = theResolver.resolve(query);
The compiler gripes thus:
error: request for member 'resolve' in 'theResolver', which is of non-class type 'boost::asio::ip::basic_resolver<boost::asio::ip::tcp, boost::asio::ip::resolver_service<boost::asio::ip::tcp> > ()(boost::asio::io_service)'
"using boost::asio::ip::tcp;" appears in an earlier included file.
I don't see why this would work elsewhere and not here. Anybody have a guess as to what the problem is? Thanks!
In Christ, Steven Watanabe

Just started using Boost, and these three lines (which compile in another project) fail here:
// Get a list of endpoints corresponding to the server name. tcp::resolver theResolver(boost::asio::io_service);
This is a function declaration.
Thanks for the reply, Steven. Yes, as it turns out, the previous programmer had created a lot of local variables with the same names as other symbols in the Boost namespaces. This created confusion when refactoring the code.
participants (2)
-
G S
-
Steven Watanabe