如何修复 PlatformIO Wire.h: No Such File or Directory
问题:
编译 PlatformIO 固件时,你看到类似这样的错误消息
wire_h_error_output.txt
In file included from .pio/libdeps/esp32dev/Adafruit INA219/Adafruit_INA219.cpp:31:0:
.pio/libdeps/esp32dev/Adafruit INA219/Adafruit_INA219.cpp:29:18: fatal error: Wire.h: No such file or directory
**************************************************************
* Looking for Wire.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:Wire.h"
* Web > https://platformio.org/lib/search?query=header:Wire.h
*
**************************************************************解决方案
将 Wire 添加到 platformio.ini 中的 lib_deps,例如,之前:
platformio_lib_deps_example.ini
lib_deps =
adafruit/Adafruit INA219 @ ^1.1.1之后:
platformio_lib_deps_fixed.ini
lib_deps =
adafruit/Adafruit INA219 @ ^1.1.1
Wire然后重新编译。
Check out similar posts by category:
Arduino, Electronics, PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow