找不到boost库

问题描述:

这是一个非常基本的问题,我只发布,因为我已经花了一些时间。这是我到目前为止做的:

This is a very basic question, I only post because I've spent already some time into it. This is what I've done so far:


  1. 下载并编译boost库:

  1. Downloaded and compiled the boost library:

sudo ./bootstrap.sh sudo ./bjam install

这种方式安装到 / usr / local / lib

在我的源代码中,我只添加了:

In my source code I've added only:


#include <boost/asio.hpp>
using boost::asio::ip::tcp



  • 我编译它:

  • I compile it with:

    g ++ -I / usr / lib / jvm / java-6-openjdk / include -L / usr / local / lib -fPIC -lboost_system -shared -o libagent.so agent.cpp

    $ c> ldd -d ./libagent.so 给我:

    However, ldd -d ./libagent.so gives me:

    libboost_system.so.1.46.1 = >未找到

    但是使用 -lboost_system ls / usr / local / lib 得到我的其他东西:

    But there is no error thrown, when using the -lboost_system and ls /usr/local/lib gets me among other things:

    libboost_system.so

    libboost_system.a

    我缺少了什么?

  • ./ bjam install 工具还运行 ldconfig(8)工具? ldconfig(8)需要在安装新库后更新 ld.so(8)使用的缓存在程序执行时。

    Did the ./bjam install tool also run the ldconfig(8) tool? ldconfig(8) needs to be run after new libraries are installed to update the caches used by ld.so(8) at program execution time.