当前位置:网站首页>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文件吗
边栏推荐
- set_multicycle_path
- Systemmediasize startup option added in esxi 7.0 update 1C
- The short jumper dsx-8000 test is normal, but the dsx-5000 test has no length display?
- USB network native driver for esxi updated to support esxi7.0 Update 2
- set_ false_ path
- Surge impact immunity experiment (surge) -emc series Hardware Design Notes 6
- VAN(DWConv+DWDilationConv+PWConv)
- Ship detection in SAR image based on yolov5
- ICC2(三)Clock Tree Synthesis
- Perl introductory learning (VIII) subroutine
猜你喜欢

Learning notes of hardware circuit design 1 -- temperature rise design

set_ clock_ groups

clickhouse建宽表多少列最合适?

Arduino reads the analog voltage_ How mq2 gas / smoke sensor works and its interface with Arduino

VAN(DWConv+DWDilationConv+PWConv)

Low power design -power switch

How can fluke dsx2-5000 and dsx2-8000 modules find the calibration expiration date?

qt实现将相关信息输出到日志文件

VS Code 基础配置与美化

mixup_ratio
随机推荐
Machine learning note 5 - logistic regression
Random life-1
Communication between DSP and FPGA
ICC2使用report_placement检查floorplan
Fluke dtx-sfm2 single mode module of a company in Hangzhou - repair case
clickhouse聚合之内存不足怎么办?那就提升聚合性能
当mysql表从压缩表变成普通表会发生什么
Monitor the CPU temperature of raspberry pie 4B installed with esxi on ARM
Cronbach’s α? Kmo coefficient? Factor load? The most understandable course of questionnaire reliability and validity analysis in history!!! (SPSS and AMOS)
set_clock_groups
论文神器 VS Code + LaTex + LaTex Workshop
雷达成像 Matlab 仿真 3 —— 多目标检测
Bert bidirectional encoder based on transformer
基于 YOLOV5 的 SAR 图像舰船检测
详解安装msdn 2015及其注意事项
Why should fluke dsx2-5000 network cable tester be calibrated once a year?
ICC2(一)Preparing the Design
Surge impact immunity experiment (surge) -emc series Hardware Design Notes 6
EfficientNET_ V1
Overall understanding of PLC