Fatal error: Adafruit_I2CDevice.h: No such file or director

Hello all,

Trying to hook up an accelerometer and keep getting this error:

In file included from .pio\libdeps\teensy40\Adafruit ADS1X15\Adafruit_ADS1X15.cpp:31:
.pio\libdeps\teensy40\Adafruit ADS1X15\Adafruit_ADS1X15.h:19:10: fatal error: Adafruit_I2CDevice.h: No such file or directory

Working off of CLion IDE and trying to upload to a Teensy 4.0. Attempted to import the Adafruit_Busio library and it didn’t help.

What’s the src/main.cpp here? If you don’t #include the libraries you put into the lib_deps, they will not be able to be built correctly, not finding their subdependencies.

these are my includes in main
Adafruit_ADS1X15.h has Adafruit_I2CDevice.h included in it, and it’s generating issues

Try this. Working fine in a minimal example.

Doesn’t appear to be working. It doesn’t seem to recognize that Adafruit_VEML9075.h has been added in the lib_deps

Screenshot 2024-10-17 125032

Greyyed out just means no function / type is used from that header file. Doesn’t matter.

What is the error message now when you build the project again?

Okay. Sanity check. Clone this repository, open it in CLion and see if it compiles correctly.

It does in fact compile correctly

Okay, so either your platformio.ini or code is the problem.

If you can’t figure it out from the reference project, we would need to see your full project to be able to resolve that error.