免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1629 | 回复: 0
打印 上一主题 下一主题

Fedora安装配置boost 1.38.0 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-16 11:46 |只看该作者 |倒序浏览
解压boost到/root/icas/boost/boost_1_38_0下,拷贝bjam到此文件夹,
注: 词句的prefix选项没起到作用,/usr/include下没有创建boost文件夹,待查!
[root@localhost boost_1_38_0]# ./bjam --prefix=/usr/include --with-system --with-thread --with-date_time --with-regex --with-serialization stage
创建timer.cpp:
#include
#include
#include
int main()
{
  boost::asio::io_service io;
    boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
      t.wait();
        std::cout << "Hello, world!\n";
          return 0;
}
[root@localhost tmp]# g++ -I /root/icas/boost/boost_1_38_0 timer.cpp -L/root/icas/boost/boost_1_38_0/stage/lib/ -lboost_system-gcc41-mt-1_38 -lboost_thread-gcc41-mt-1_38
[root@localhost tmp]# ./a.out
./a.out: error while loading shared libraries: libboost_system-gcc41-mt-1_38.so.1.38.0: cannot open shared object file: No such file or directory
说明未设置环境变量
[root@localhost tmp]# LD_LIBRARY_PATH=/root/icas/boost/boost_1_38_0/stage/lib
[root@localhost tmp]# export LD_LIBRARY_PATH
[root@localhost tmp]# ./a.out
Hello, world!
[root@localhost tmp]#
TODO: 将编译好的lib以及boost头文件都放到/usr/include/boost目录下,避免每次编译都输入路径


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/87077/showart_1901405.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP