找不到boost库 [英] Cannot find boost library

查看:238
本文介绍了找不到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.

    这篇关于找不到boost库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆