C++ 加载共享库时出现thraxcompiler错误:libthrax.so.0
我已经成功安装了openfst和thraxcompiler。thraxmakedep成功创建make文件C++ 加载共享库时出现thraxcompiler错误:libthrax.so.0,c++,compiler-errors,openfst,thrax-grammer,thrax-compiler,C++,Compiler Errors,Openfst,Thrax Grammer,Thrax Compiler,我已经成功安装了openfst和thraxcompiler。thraxmakedep成功创建make文件 thraxOpenGrm/thrax-1.1.0/src/grammars$ thraxmakedep example.grm 创建make文件后,当我运行make时,会出现以下错误 thraxOpenGrm/thrax-1.1.0/src/grammars$ make thraxcompiler --input_grammar=byte.grm --output_far=byte.far
thraxOpenGrm/thrax-1.1.0/src/grammars$ thraxmakedep example.grm
创建make文件后,当我运行make时,会出现以下错误
thraxOpenGrm/thrax-1.1.0/src/grammars$ make
thraxcompiler --input_grammar=byte.grm --output_far=byte.far
thraxcompiler: error while loading shared libraries: libthrax.so.0: cannot open shared object file: No such file or directory
make: *** [byte.far] Error 127
但该库存在于路径中:
/usr/local/lib/libthrax.so.0
我尝试了一些适用于gcc编译器的步骤,如
export LD\u LIBRARY\u PATH=/usr/local/lib
,使用-Wl,-rpath
,-Llib
等标志 出现此问题的原因是Thrax编译器无法找到所需的库。执行命令sudo ldconfig
修复它
或者,可以通过在
/usr/lib/
中复制该库(libthrax.so.0)来修复此问题。另一个选项是设置此选项,以便找到共享库:
export LD_LIBRARY_PATH=/usr/local/lib
我试过了,但这是暂时的解决办法。每次重新启动时,我都要设置它