Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies are not scanned for in libraries #4154

Open
Semnodime opened this issue Oct 17, 2024 · 0 comments
Open

Dependencies are not scanned for in libraries #4154

Semnodime opened this issue Oct 17, 2024 · 0 comments

Comments

@Semnodime
Copy link

TLDR
If my main.cpp has the line #include <Wire.h>, then Wire is added to the dependency graph.
If not, then a library fails to build, despite its header having this line as well.

I created a new PlatformIO project for the sparkfun_promicro16 and copied the lib_deps list from the platformio.ini of an old project.

lib_deps = 
	adafruit/Adafruit GFX Library@^1.11.5
	adafruit/Adafruit BusIO@^1.14.1
	adafruit/Adafruit ILI9341@^1.5.12
	moononournation/GFX Library for Arduino@^1.3.1
	git+https://github.com/adafruit/Adafruit_SSD1306

The new project has only the boilerplate code and thus does not reference any libraries yet.

Error
Though, when I build the project, I get error messages, detailing that the file Wire.h cannot be found (fatal error: Wire.h: No such file or directory).

Workaround
If I add #include <Wire.h> to the main.cpp (although it is not used in it!), it will also be added to the Dependency Graph and building the libary will succeed.

Compiling .pio/build/sparkfun_promicro16/lib450/Adafruit BusIO/Adafruit_SPIDevice.cpp.o
In file included from .pio/libdeps/sparkfun_promicro16/Adafruit BusIO/Adafruit_BusIO_Register.h:9:0,
                 from .pio/libdeps/sparkfun_promicro16/Adafruit BusIO/Adafruit_BusIO_Register.cpp:1:
.pio/libdeps/sparkfun_promicro16/Adafruit BusIO/Adafruit_I2CDevice.h:5:10: fatal error: Wire.h: No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant