
Alessandro Candini
I'm really interested in exemple 5 of boost asio:
http://www.boost.org/doc/libs/1_47_0/doc/html/boost_asio/tutorial/tuttimer5/...
I've tried it with boost-1.47.0. I can compile without warnings using:
g++ -Wall -pedantic -lboost_thread -lboost_system -o timer5 timer5.cpp
but when I launch the executable it gives me a Segmentation fault.
Commenting the code I found that the segmentation fault raise at the 3rd line of main:
boost::thread t(boost::bind(&boost::asio::io_service::run, &io));
I'm trying on the following machine: Linux office-007 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:02:55 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Just in case people find this thread via searching... Alessandro found and solved his problem. Using 'ldd', he discovered that the executable had been linked to a shared object from an older version of Boost, which created an incompatibility at runtime. Completely removing the old version then relinking the executable fixed the issue. Regards, Tony