我使用下面的代码来测试谷歌的RE2库RE2库加载
int main()
{
int r = RE2::FullMatch("hello", "h.*o");
cout <<" match = " << r << endl;
return 0;
}
我使用下面的命令compling -
g++ -lre2 -o retest retest.cc
它正在编制很好,但是当我试图运行重新测试./retest其抛出以下错误 -
error while loading shared libraries: libre2.so.0: cannot open shared object file: No such file or directory
我已检查和libre2.so.0库存在于user/local/lib目录和re2/obj/so目录中。那么,为什么这个错误是我忘了一些细节添加?
这是一个解决方案吗? http://edn.embarcadero.com/article/32861。只需将您的LD_LIBRARY_PATH设置为指向libre.so.0所在的lib目录即可。 – Lucian
位于哪里是libre2.so.0文件?它在你的'LD_LIBRARY_PATH'和/或来自/etc/ld.so.conf的路径中吗?安装后你运行了ldconfig吗? – PlasmaHH
[Linux加载共享库时出错:无法打开共享目标文件:没有这样的文件或目录]可能的重复(http://stackoverflow.com/questions/480764/linux-error-while-loading-shared-libraries-cannot -open-shared-object-file-no-s) –