加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 在ubuntu上设置boost库时出现问题

发布时间:2020-12-16 10:26:59 所属栏目:百科 来源:网络整理
导读:我已经在ubuntu 9.10中的’/ media / data / bin’中编译并安装了我的boost库. 我已经设置了INCLUDE_PATH,LIBRARY_PATH环境: $echo $INCLUDE_PATH/media/data/bin/boost/include:$echo $LIBRARY_PATH/media/data/bin/boost/lib: 但是当我编译asio示例时,我
我已经在ubuntu 9.10中的’/ media / data / bin’中编译并安装了我的boost库.
我已经设置了INCLUDE_PATH,LIBRARY_PATH环境:

$echo $INCLUDE_PATH
/media/data/bin/boost/include:
$echo $LIBRARY_PATH
/media/data/bin/boost/lib:

但是当我编译asio示例时,我收到以下错误:
$g blocking_tcp_echo_server.cpp

blocking_tcp_echo_server.cpp:13:26: error: boost/bind.hpp: No such file or directory
blocking_tcp_echo_server.cpp:14:31: error: boost/smart_ptr.hpp: No such file or directory
blocking_tcp_echo_server.cpp:15:26: error: boost/asio.hpp: No such file or directory
blocking_tcp_echo_server.cpp:16:28: error: boost/thread.hpp: No such file or directory
blocking_tcp_echo_server.cpp:18: error: ‘boost’ has not been declared
blocking_tcp_echo_server.cpp:22: error: ‘boost’ has not been declared
blocking_tcp_echo_server.cpp:22: error: expected initializer before ‘<’ token
blocking_tcp_echo_server.cpp:24: error: variable or field ‘session’ declared void
blocking_tcp_echo_server.cpp:24: error: ‘socket_ptr’ was not declared in this scope

解决方法

出什么问题了

sudo apt-get install libboost-dev

之后您不需要设置任何-I和-L标志.如果你需要Boost 1.40,你仍然可以重建当前的Debian unstable包.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读