无法找到boost库 [英] Cannot find boost library

查看:282
本文介绍了无法找到boost库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常基本的问题,我只职位,因为我已经花了一些时间进去。这是我迄今所做的:


  1. 下载并编译Boost库:

    须藤./bootstrap.sh 须藤./bjam安装

    此方式,它被安装到的/ usr / local / lib目录


  2. 在我的源$ C ​​$ C,我只说:


     的#include<升压/ asio.hpp>
    使用boost ::支持ASIO ::知识产权:: TCP



  3. 我编译:

    G ++ -I / usr / lib目录/ JVM / JAVA-6的OpenJDK / -L包括在/ usr / local / lib目录-fPIC -shared -lboost_system -o libagent.so agent.cpp


  4. 然而, LDD -d ./libagent.so 给我:

    libboost_system.so.1.46.1 =>没有找到


  5. 但没有抛出的错误,当使用 -lboost_system LS的/ usr / local / lib目录让我除其他事项:

    libboost_system.so 结果
    libboost_system.a


我是什么失踪?


解决方案

做了 ./的bjam安装工具还运行 ldconfig的(8) 工具? ldconfig的(8)后需要新库安装更新由 ld.so(8)在程序的执行时间。

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. Downloaded and compiled the boost library:

    sudo ./bootstrap.sh and sudo ./bjam install

    This way it was installed into /usr/local/lib.

  2. In my source code I've added only:

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

  3. 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

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

    libboost_system.so.1.46.1 => not found

  5. 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

What am I missing?

解决方案

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天全站免登陆