当前位置:网站首页>error: redefinition of ‘xxx‘
error: redefinition of ‘xxx‘
2022-07-28 05:25:00 【Alice_wm】
问题描述
Arduino项目导入PlatformIO编译遇到error: redefinition of ‘xxx’…note: ‘float humidity’ previously defined here,编译报错二十条,全是一个错误:

原因分析:
网上查到的都说是目标头文件.h没有加条件编译语句:
#ifndef _TEST_H_
#define _TEST_H_
//。。。
#endif
然后我发现我引入的头文件已经是加了条件编译语句,后来发现工程项目中有两个.ino文件,这两个文件名虽然不同,但是内容一样(我的导入前是没有co2-sensor-main.ino这个文件的,不知道怎么产生的),然后我删掉一个,编译就通过了。
主要就是这两句话,***In file included from C:/Users/Administrator/Documents/PlatformIO/Projects/220614-094530-huzzah/src/co2-sensor-main.ino:4:
src\thermometer.h:8:7: error: redefinition of ‘Adafruit_SSD1306 display’
***In file included from C:/Users/Administrator/Documents/PlatformIO/Projects/220614-094530-huzzah/src/co2-sensor.ino:4:
src\thermometer.h:8:7: note: ‘Adafruit_SSD1306 display’ previously declared here
重新定义“Adafruit_SSD1306 display”
注意:'Adafruit_SSD1306 display’之前在这里声明过
加粗的字体从这里我们可以我感觉两个文件中有重复引用,然后我打开对比后,发现一样的代码,所以删掉一个后,尝试编译,这次通过了。
有大佬指点一下为什么会多生成一个.ino文件吗
边栏推荐
- Shuffle Net_v1-shuffle_v2
- qt中获取当前目录
- Bert bidirectional encoder based on transformer
- Beginners choose sensors
- 保研面试中常见的英语问题有哪些?
- Word邮件合并功能详解:合并后生成多个word文档,删除空白页
- CString to char[] function
- How to test industrial Ethernet cables (using fluke dsx-8000)?
- Precautions for EMI design of switching power supply circuit in layout process
- Pytorch learning note 4 - automatic calculation of gradient descent autograd
猜你喜欢

T-sne dimension reduction visualization

Overall understanding of PLC

VS Code 基础配置与美化

Install visual studio 2019 steps and vs2019 offline installation package on win7

qt中Qthread线程的使用以及安全关闭

基于 YOLOV5 的 SAR 图像舰船检测

雷达成像 Matlab 仿真 4 —— 距离分辨率分析

ASP. Net read database bound to treeview recursive mode

What is the AEM testpro cv100 and fluke dsx-8000 of category 8 network cable tester?

Graduation thesis | how to write literature review
随机推荐
Vs code basic configuration and beautification
Synopsys Multivoltage Flow
Perl入门学习(十一)文件操作
Distinguishing PCB quality by color is a joke in itself
Why should fluke dsx2-5000 network cable tester be calibrated once a year?
毕业论文 | 文献综述应该怎么写
Led selection - hardware learning notes 3
EfficientNET_V1
雷达成像 Matlab 仿真 2 —— 脉冲压缩与加窗
Surge impact immunity experiment (surge) -emc series Hardware Design Notes 6
详解安装msdn 2015及其注意事项
mysql删表不删库
[yolov5] environment construction: win11 + mx450
EMC experiment practical case ESD electrostatic experiment
MATLAB signal processing
Bert bidirectional encoder based on transformer
Precautions for EMI design of switching power supply circuit in layout process
低功耗设计-Power Switch
Electric fast burst (EFT) design - EMC series hardware design notes 4
CString to char[] function