You must compile it with:
g++ -I/usr/lib/jvm/java-6-openjdk/include -L/usr/local/lib -Wl,-rpath,/usr/local/lib -fPIC -lboost_system -shared -o libagent.so agent.cpp
This forces you to search for the boost library in / usr / local / lib at run time, the -L option only causes it to search in / usr / local / lib at compile time.
source share