本帖最后由 封存into 于 2025-7-28 11:12 编辑
在静态C++库中包含stm32f1xx_hal.h无效。我正将stm32f1xx_hal.h导入我的静态C++库以访问标准类型和函数。
当项目还是C语言时可以正常工作,但迁移到C++后就不再识别这些类型了,尽管头文件包含并没有报错。
已经设置了包含保护宏和extern "C"声明:
#ifndef LTC6803LIBF103_HPP#define LTC6803LIBF103_HPP #ifdef __cplusplusextern "C" {#endif #include <stm32f1xx_hal.h> >>code<< #ifdef __cplusplus}#endif #endif
奇怪的是它似乎能和我其他一些库一起工作,不知道这个库出了什么问题
|
|