C++,错误:尚未声明'__locale_t'
C++, error: '__locale_t' has not been declared
我是c++的新手,当我包含一些头文件时,我得到了error: '__locale_t' has not been declared
,如#include "ruby.h"
, #include <string.h>
等,但#include <stdio.h>
没有问题,我在Linux下使用eclipse, #include "ruby.h"
和#include <string.h>
的详细错误是:
/usr/include/string.h:548: error: '__locale_t' has not been declared
/usr/include/string.h:549: error: nonnull argument references non-pointer operand (argument 1, operand 3)
/usr/include/string.h:552: error: '__locale_t' has not been declared
/usr/include/string.h:553: error: nonnull argument references non-pointer operand (argument 1, operand 4)
包含的顺序为:
#include "Abc.h"
#include <string.h>
#include "ruby.h"
#include <stdio.h>
其中Abc
为类名。
这是Abc
类,除了include
:
#include "Abc.h"
#include <stdio.h>
#include <string.h>
#include "ruby.h"
#include "ose_gw.h"
namespace a {
Abc::Abc() {
// TODO Auto-generated constructor stub
}
Abc::~Abc() {
// TODO Auto-generated destructor stub
}
} /* namespace a */
尝试编译:
g++ -D__USE_XOPEN2K8 ...
xlocale.h
仅在定义__USE_XOPEN2K8
时才包含在string.h
中)
这显然是一个已知的问题,它被记录为错误,但实际上是某种微妙的配置错误。
见https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52922
我是一个Windows用户,这不是我的能力范围,但答案在某处(我认为)。
相关文章:
- #ifdef和未声明的标识符
- 未声明的标识符编译暗黑破坏神 2 程序"muleview"
- 在顶点着色器中使用 OpenGl 的未声明标识符,我在顶点着色器中绘制三角形时遇到问题
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 在气泡排序程序中未声明错误功能
- 我在范围内未声明的错误类有问题
- 使用未声明的标识符"sqrt"?
- 我包含了<winuser.h>,但编译器在MonitorFromWindow上抛出"未声明"
- 对类 (C++) 中的私有变量使用未声明的标识符
- 我的代码中有错误,未声明的标识符
- 未定义的标识符/未声明
- 错误:在 C++ 'std'使用未声明的标识符
- 在编译器之前检测未声明的标识符
- 使用未声明的标识符'temp'
- 使用未声明的标识符"yylex"和"yyin"?
- 使用"class"关键字,后跟未声明的标识符
- 未声明的标识符错误,但变量定义正确 (?)
- C2065 'cout':未声明的标识符
- 在此范围内未声明错误"Clreol"
- C++模板模板参数中未声明的标识符