Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 加载共享库时出现thraxcompiler错误:libthrax.so.0_C++_Compiler Errors_Openfst_Thrax Grammer_Thrax Compiler - Fatal编程技术网

C++ 加载共享库时出现thraxcompiler错误:libthrax.so.0

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

我已经成功安装了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
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

我试过了,但这是暂时的解决办法。每次重新启动时,我都要设置它