c和c++混合编译的问题,需要在GUI_Paint.h、DEV_Config.h、EPD_2in13bc.h中使用extern "C"将你的函数声明包含,例如EPD_2in13bc.h中使用如下写法
- #ifndef __EPD_2IN13BC_H_
- #define __EPD_2IN13BC_H_
- #include "DEV_Config.h"
- // #include "epd\DEV_Config.h"
- // Display resolution
- #define EPD_2IN13BC_WIDTH 152
- #define EPD_2IN13BC_HEIGHT 296
- #ifdef __cplusplus
- extern "C" {
- #endif
- void EPD_2IN13BC_Init(void);
- void EPD_2IN13BC_Clear(void);
- void EPD_2IN13BC_Display(const UBYTE *blackimage, const UBYTE *ryimage);
- void EPD_2IN13BC_Sleep(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
复制代码
另外改完后发现你的CMakeLists.txt没有引用DEV_Config.cpp,添加上即可编译成功
|