【发布时间】:2017-01-05 06:09:41
【问题描述】:
所以我刚刚开始使用 Google 的 OpenFST 工具包,并且正在尝试他们的示例。在 Eclipse Mars 上使用 C++ 并在构建时出现以下错误:
fatal error: 'type_traits' file not found
这是我的示例程序 - 当我从 here 尝试时。
#include <iostream>
#include <fst/fst-decl.h>
#include <fst/fstlib.h>
using namespace std;
int main() {
fst::StdVectorFst fst;
return 0;
}
当我构建它时,我收到以下错误:
/usr/local/include/fst/util.h:15:10: fatal error: 'type_traits' file not found
#include <type_traits>
^
1 error generated.
make: *** [src/sampleFST.o] Error 1
是否存在链接器错误?为什么找不到那个头文件?它确实存在于我计算机上的/usr/include/c++/4.2.1/tr1/ 目录中。我做错了什么?
【问题讨论】:
-
gcc 4.2 是化石。升级。
-
gcc 6.0 是最新的吗?
-
6.3 和 5.4 是最新的,但任何 5 或 6 版本都应该这样做。
-
@n.m.我刚刚升级了我的 gcc,但错误仍然存在 :(
-
您可能需要将 -std=c++11 标志传递给 g++。
标签: c++ eclipse-cdt typetraits openfst