分析:
包含我在某个C头文件中包含了C++
#ifdef __cplusplus //bsp_GPIO.h .c 被 cpp文件引用,需要如此添加 extern "C" { #endif //----------本文件需要引出的函数----------// int GPIO_OutEnable(int fd, unsigned int dwEnBits); int GPIO_OutDisable(int fd, unsigned int dwDisBits); int GPIO_OpenDrainEnable(int fd, unsigned int dwODBits); int GPIO_OutSet(int fd, unsigned int dwSetBits); int GPIO_OutClear(int fd, unsigned int dwClearBits); int GPIO_PinState(int fd, unsigned int* pPinState); int GPIO_IrqEnable(int fd, unsigned int dwEnBits); #ifdef __cplusplus } #endif
注:C文件不可以引用C++文件,在现实当中,只能够在C++里面引用c文件,不可以在C中引用CPP文件,除非你的CPP文件里完全是使用C写的代码。子集要用超集,这从逻辑上是不成立的.
来源:博客园
作者:硕果磊磊
链接:https://www.cnblogs.com/shuoguoleilei/p/11425336.html