I'm having problems with compiling a program which includes "boost/asio.hpp".
Compiling this program(taken from boost site):
example.cpp:
#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
using namespace boost::lambda;
typedef std::istream_iterator<int> in;
std::for_each(
in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
with
c++ -I path/to/boost_1_55_0 example.cpp -o example
works fine. But when the program includes:
boost/asio.hpp
And I'm trying to compile it with:
g++ -I /usr/local/boost_1_55_0 example.cpp -o example -lboost_system -lboost_thread
an executable is generated ,but I'm getting this error when trying to execute "example":
./example: error while loading shared libraries: libboost_system.so.1.55.0: cannot open shared object file: No such file or directory
The file "libboost_system.so.1.55.0" is located at "/usr/local/lib". I also tried to compile the program with :
g++ -I /usr/local/boost_1_55_0 -L/usr/local/lib example.cpp -o example -lboost_system -lboost_thread
And got the same error.
How can I fix this?