C ++, error: '__locale_t' was not declared

I am new to C ++, I got error: '__locale_t' has not been declaredwhen I included some header files, such as #include "ruby.h", #include <string.h>etc., but there is no problem for #include <stdio.h>, I use eclipse under Linux, a detailed error for #include "ruby.h"and #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)

The order of inclusion:

#include "Abc.h"

#include <string.h>
#include "ruby.h"
#include <stdio.h>

Where Abcis the name of the class.

This is a class Abc, nothing has been added except 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 */
+4
source share
2 answers

Try compiling with:

g++ -D__USE_XOPEN2K8 ...

(. https://sourceware.org/bugzilla/show_bug.cgi?id=10456, , xlocale.h string.h, __USE_XOPEN2K8)

+7
0

Source: https://habr.com/ru/post/1548349/


All Articles