简而言之...
C++程序,但随后“错误:libboost_thread.so .1.46.1:无法打开共享目标文件:运行时显示“没有这样的文件或目录”。程序编译罚款与升压库,但(使用升压库)编译在Eclipse罚款运行它时,错误
详细
我对C++运行的基本程序来检查,我能正确使用升压线程库。
#include <boost/thread/thread.hpp>
#include <iostream>
void hello()
{
Std::cout<<”Hello, I am a thread”<<std::endl;
}
int main()
{
boost::thread th1(&hello);
th1.join();
}
的代码编译好,所以我认为,我已经安装并正确设置了Boost库(添加目录包括等)
然而,当我尝试运行该程序,我得到以下错误在CONSOL
error while loading shared libraries: libboost_thread.so.1.46.1: cannot open shared object file: No such file or directory
你试过在你的系统上找到libboost_thread.so.1.46.1文件吗?它是否在搜索路径中? – littleadv 2011-06-10 08:35:45
libboost_thread.so.1.46.1在我的系统上,我可以找到它没有问题。它也可以在图书馆目录中找到。 – Andy 2011-06-13 12:14:28
有没有什么你必须做的共享库(.so)文件,使LD_LIBRARY_PATH看到他们? – Andy 2011-06-13 12:15:26