Open tianzixiaotanzhong opened 3 years ago
抱歉,现在才回复!
_ansi.h 是 newlib 提供的头文件,Keil 环境可能没有提供该头文件。引入 _ansi.h 是为了使用 _BEGIN_STD_C
和 _END_STD_C
宏定义,它们的具体定义如下:
/* ISO C++. */
#ifdef __cplusplus
#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
#ifdef _HAVE_STD_CXX
#define _BEGIN_STD_C namespace std { extern "C" {
#define _END_STD_C } }
#else
#define _BEGIN_STD_C extern "C" {
#define _END_STD_C }
#endif
#if __GNUC_PREREQ (3, 3)
#define _NOTHROW __attribute__ ((__nothrow__))
#else
#define _NOTHROW throw()
#endif
#endif
#else
#define _BEGIN_STD_C
#define _END_STD_C
#define _NOTHROW
#endif
如果你的工程是纯 C 的工程,可以直接注释/删除 #include <_ansi.h>
、_BEGIN_STD_C
和 _END_STD_C
这几行。
如果你的工程是 C 和 C++ 混合的工程,可以先注释/删除 #include <_ansi.h>
,再添加如下宏定义:
#define _BEGIN_STD_C extern "C" {
#define _END_STD_C }
packages/ssd1306-latest/inc\ssd1306.h(12): error: '_ansi.h' file not found
请问这是什么问题呢,我的Keil工程得在RT_Thread的BSP下使用Env工具生成的