文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Fedora安装配置boost 1.38.0

Fedora安装配置boost 1.38.0

时间:2009-04-16  来源:tfengjun

解压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 <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

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目录下,避免每次编译都输入路径
相关阅读 更多 +
排行榜 更多 +
平衡球球

平衡球球

休闲益智 下载
平衡球球游戏

平衡球球游戏

休闲益智 下载
土耳其方块消除游戏

土耳其方块消除游戏

休闲益智 下载