centos7编译buildroot报错/usr/include/xlocale.h:27:16: error: redefinition of ‘struct __locale_struct‘

/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 */

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值