C++/OpenFST - 查找库和链接时出错

标签 c++ linux shell openfst

在 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/

相关文章:

c++ - 对 std::vector::iterator 使用 vs. typedef

c++ - 什么时候 std::shared_timed_mutex 比 std::mutex 慢,什么时候(不)使用它?

linux - ffmpeg 不接受脚本中的输入

linux - 带有引号参数的系统用户、smb 用户和 netatalk 用户的 Bash 脚本

linux - cut 操作 - 奇怪的行为

bash - 用于重命名与 sha1sum 不匹配的文件夹和子目录中的每个文件的 Ubuntu 脚本

c++ - 找不到 MyClass.cpp

c++ - 使用 Raspberry Pi 和 Qt 的 Poco C++

java应用程序的python mechanize问题

c++ - Linux C++ 应用程序文件保护