linux 下使用 boost::bind ,程序崩溃了
打算在linux 下学习boost,最近在学boost bind。
看了一些资料不懂,如下程序为啥运行会崩溃。
代码:
#include <stdio.h>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
static void handler()
{
printf(" handler \n");
}
int main()
{
boost::bind(&handler)();
...
运行的时候出现错误:
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): bind: Permission denied
Aborted (core dumped)
linux 是centos6.5的,