这是一个非常基础的问题,我发帖只是因为我已经花了一些时间在上面。目前为止,以下是我所做的内容:
Downloaded and compiled the boost library:
sudo ./bootstrap.sh
andsudo ./bjam install
This way it was installed into
/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
However,
ldd -d ./libagent.so
gives me:libboost_system.so.1.46.1 => not found
But there is no error thrown, when using the
-lboost_system
andls /usr/local/lib
gets me among other things:libboost_system.so
libboost_system.a
我漏掉了什么?