2
votes

I've been using boost under windows for a while, and now have a need to migrate a couple of existing apps to run on Ubuntu 12 box for a demonstration. This app creates two worker threads, one to log incoming UDP data, and another to listen to a separate port and print that data to the screen.

I've gotten everything else to work, but for some reason the following line is failing with an error of "Invalid overload of boost::asio::io_service::run"

m_logThread = new boost::thread( boost::bind( &boost::asio::io_service::run, m_ioServicePtr ));

This line works fine on my Win32 machine, but gives the invalid overload error on linux.

There are also two other errors:

boost::bind is ambiguous

and

type boost::thread could not be resolved

But I'm pretty sure they stem from the other error. I am definitely including the boost headers, since the compiler isn't complaining about my class having pointers to IO services and Threads as member variables, it's just the line which should spawn the worker threads that's the issue.

I believe I've got boost installed correctly, as it's perfectly happy with the header locations.

Many thanks in advance.

1

1 Answers

3
votes

The error is be that boost::asio::io_service::run is overloaded, in which case you have to resolve the ambiguity.