提示例如:GPC_S.axf: Error: L6218E: Undefined symbol FLASH_EraseSector(int) (referred from protocolalarm.o). 原因就是C跟C++公用,c++引用了C的文件,C的文件要声明用C报错就消失了 #ifdef __cplusplus extern “C”{ #endif //C文件的内容 #ifdef __cplusplus } #endif