在 OpenFST 中 web site上面写着;
The OpenFst library is a C++ template library. From C++, include in the installation include directory and link to libfst.so in the installation library directory.
为了简单起见,我的代码只包含这个;
#include <fst/fstlib.h>
#include <iostream>
int main(){
}
我在 /home/me/usr/include/fst 下有 fSTLib.h ,在 /home 下有 libfst.so/我/usr/lib。我试过了;
$g++ -I/home/me/usr/include/ code.cpp -lfst -L/home/me/usr/lib
基于 this solution .
但是我遇到了很多关于找不到库的错误。喜欢this .
你对我有什么建议?谢谢。
最佳答案
尝试将 -std=gnu++11 添加到您的编译行:
$g++ -std=gnu++11 -I/home/me/usr/include/ code.cpp -lfst -L/home/me/usr/lib
如果您总是遇到类似的问题,请查找编译时出现在日志中的第一条错误消息。
希望对您有所帮助! :-)
关于C++/OpenFST - 查找库和链接时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50966955/