gpt4 book ai didi

C++,错误 : '__locale_t' has not been declared

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:28:50 25 4
gpt4 key购买 nike

我是 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 ...

(另请参阅 https://sourceware.org/bugzilla/show_bug.cgi?id=10456,其中提到 xlocale.h 仅在定义了 __USE_XOPEN2K8 时包含在 string.h 中)

关于C++,错误 : '__locale_t' has not been declared,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24738059/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com