/usr/include/xlocale.h:27:16: error: redefinition of 'struct __locale_struct'
typedef struct __locale_struct
^~~~~~~~~~~~~~~
In file included from /usr/include/bits/types/locale_t.h:22,
from /usr/include/stdlib.h:272,
from ../glib/gstrfuncs.c:35:
/usr/include/bits/types/__locale_t.h:28:8: note: originally defined here
struct __locale_struct
...
在buildroot中编译,以为是build中下载的库文件的问题,结果最后排查是调用Host中的
/usr/include/xlocale.h
解决方法:
把 /usr/include/xlocale.h 中的内容屏蔽掉,如下所示
#ifndef _XLOCALE_H
#define _XLOCALE_H 1
#if 0
/* Structure for reentrant locale using functions. This is an
(almost) opaque type for the user level programs. The file and
this data structure is not standardized. Don't rely on it. It can
go away without warning. */
typedef struct __locale_struct
{
/* Note: LC_ALL is not a valid index into this array. */
struct __locale_data *__locales[13]; /* 13 = __LC_LAST. */
/* To increase the speed of this solution we add some special members. */
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
/* Note: LC_ALL is not a valid index into this array. */
const char *__names[13];
} *__locale_t;
/* POSIX 2008 makes locale_t official. */
typedef __locale_t locale_t;
#endif
#endif /* xlocale.h */