28 lines
968 B
Markdown
28 lines
968 B
Markdown
1. [Arduino头文件包含的注意](https://blog.csdn.net/weixin_42042056/article/details/118190017?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-118190017-blog-22197877.pc_relevant_3mothn_strategy_recovery&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-118190017-blog-22197877.pc_relevant_3mothn_strategy_recovery&utm_relevant_index=1)
|
||
|
||
2. C++和C语言冲突的问题解决相关
|
||
|
||
C语言和C++冲突的问题:
|
||
|
||
```c
|
||
error: unknown type name 'class'
|
||
error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
|
||
error: unknown type name 'SPIClass'
|
||
|
||
```
|
||
|
||
解决 :把所有的.c改成.cpp;删除
|
||
|
||
```c
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
/*代码块*/
|
||
#ifdef __cplusplus
|
||
extern "C" }
|
||
#endif
|
||
```
|
||
|
||
3. Arduino添加头文件的方法:后面添加...
|
||
|