Compiling error when trying to use a library

I'm having an issue with compiling code for my Arduino Nano; I installed the adrafruit dht11 sensor library, it is in my folder, but I am unable to compile my code when I include it. The error message I'm getting is:
Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P"

In file included from C:\Users\jason\OneDrive\Documents\Arduino\sketch_may24a\sketch_may24a.ino:2:0:

C:\Users\jason\OneDrive\Documents\Arduino\libraries\DHT_sensor_library/DHT_U.h:36:10: fatal error: Adafruit_Sensor.h: No such file or directory

#include <Adafruit_Sensor.h>


compilation terminated.

exit status 1

Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
(I didn't add the lines it just did that when I pasted.)
My code isn't the problem because the compiling issue happens when I have no code.
The file I downloaded is in my library's folder.
Thank you for your time.

It should be in the libraries folder.

it is, I said that at the end

Your screenshot does not look right. There should be a whole lot of libraries in there.

Go here:
And scan down about halfway and start reading at "Manual installation"

Hi @drearydingo2. Something that might be a little confusing at first is that libraries can have dependencies on the code for other libraries. So you need to install the libraries your sketch uses, and the libraries those libraries use, and so on...

This is the case with the "DHT sensor library" you're using, as it says in the library's documentation:

You can see instructions for how to install it here:

One thing to note is that the Arduino IDE's Library Manager can usually handle all this automagically for you. When you are installing libraries via Library Manager, you may get a dialog asking you:

Would you like to install also all the missing dependencies?

If so, click the Install all button. This will install all the libraries the library author defined as dependencies of their library, and all the dependencies defined by those libraries, and so on... This has been configured in the "DHT sensor library" you're using:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.