当前位置:网站首页>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文件吗
边栏推荐
- Hugging face 的问题记录 I
- Mae mask self encoding is scalable learning
- Design and analysis of contactor coil control circuit
- IMS-FACNN(Improved Multi-Scale Convolution Neural Network integrated with a Feature Attention Mecha
- set_ clock_ groups
- Trouble encountered in cable testing -- a case study of a manufacturer?
- [yolov5] environment construction: win11 + mx450
- A NOVEL DEEP PARALLEL TIME-SERIES RELATION NETWORK FOR FAULT DIAGNOSIS
- ICC2分析时序的神器 analyze_design_violations
- vi和vim命令
猜你喜欢

Redhawk Dynamic Analysis

How to view the transfer function of the module directly built by Simulink

An example of bill printing

clock tree分析实例

Low power design -power switch

mixup_ ratio

Selection of PLC

Bert bidirectional encoder based on transformer

clickhouse建宽表多少列最合适?

Electric fast burst (EFT) design - EMC series hardware design notes 4
随机推荐
OpenGL快速配置方法
set_clock_groups
Hugging face 的问题记录 I
Perl introductory learning (VIII) subroutine
Low power design -power switch
mixup_ ratio
Mae mask self encoding is scalable learning
Synopsys Multivoltage Flow
天线效应解决办法
npm yarn相关的操作
Pycharm2019设置编辑器主题和默认代码
PyTorch 学习笔记 4 —— 自动计算梯度下降 AUTOGRAD
qt中Qthread线程的使用以及安全关闭
Hugging face 的入门使用
Word邮件合并功能详解:合并后生成多个word文档,删除空白页
A NOVEL DEEP PARALLEL TIME-SERIES RELATION NETWORK FOR FAULT DIAGNOSIS
Install visual studio 2019 steps and vs2019 offline installation package on win7
Overall understanding of PLC
[yolov5] environment construction: win11 + mx450
How to calibrate dsx2-8000? Calibration process?