Asio 1.6: compile error in signal_set_service with MSVC10

Hi, I was just updating Boost from 1.46.1 to 1.47 and encountered a compile error inside Asio. Since there is no major outcry on this list I guess I've made an error anywhere in the upgrade process or my code. When compiling my static library that contains the networking code with (our only compiler) Visual Studio 2010 I get compile errors in asio/detail/impl/signal_set_service.ipp in line 74 saying 'boost::signal': use of class template requires template argument list As a remedy I simply defined BOOST_ASIO_DISABLE_SIGNAL, the code compiles fine and I did not recognize any problems at a first short test. I tried to make a simple example showing the error, but I was not able to reproduce this easily. So I thougt I ask what disabling signals means for Asio and if this is a valid workaround, or if I really should try to get this compile error fixed before working with 1.47. thanks, Norbert

When compiling my static library that contains the networking code with (our only compiler) Visual Studio 2010 I get compile errors in asio/detail/impl/signal_set_service.ipp in line 74 saying 'boost::signal': use of class template requires template argument list
Perhaps, you import boost::signal into the global namespace before including asio headers.

On 19.07.2011 15:34, Igor R wrote:
When compiling my static library that contains the networking code with (our only compiler) Visual Studio 2010 I get compile errors in asio/detail/impl/signal_set_service.ipp in line 74 saying 'boost::signal': use of class template requires template argument list
Perhaps, you import boost::signal into the global namespace before including asio headers.
Not quite. I didn't think of that possibility, since I usually don't
import anything into the global namespace. But I found an (unnecessary)
include of

But I found an (unnecessary) include of
. And that was enough to cause the problem. So thank you very much for the quick solution. I totally didn't think of that.
I now managed to build a testcase that consists of an empty main() function and the two includes, that causes the described error. See the code below.
thanks for your hint, Norbert ---------------------
#include
#include int main(int argc, char **argv) { return 0; }
This's a bug in asio, in boost\asio\detail\impl\signal_set_service.ipp, line 71: - signal(signal_number, asio_signal_handler); + ::signal(signal_number, asio_signal_handler);
participants (2)
-
Igor R
-
Norbert Wenzel