fatal error C1189: #error : "eh.h is only for C++!"
#ifndef __cplusplus
#error "eh.h is only for C++!"
#endif
The cause :
include a C++ header file in a .c file.
for example: In a.c, you included <iostream>
#ifndef __cplusplus
#error "eh.h is only for C++!"
#endif
The cause :
include a C++ header file in a .c file.
for example: In a.c, you included <iostream>
本文探讨了在C源文件中错误地包含了C++的头文件导致的编译错误,具体表现为预处理指令#error的触发。文章解释了这一错误产生的原因,并给出了解决方案:确保使用正确的语言标准来包含相应的头文件。
4万+

被折叠的 条评论
为什么被折叠?



