multiple libraries

hello everyone, i’m trying to upload a code for Dht-11 sensor,but the compiler displays an error because of multiple libraries. how to solve this problem ?

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\Mohamed\Documents\Arduino\libraries\DHT_sensor_library\DHT_U.cpp:22:0:

C:\Users\Mohamed\Documents\Arduino\libraries\DHT_sensor_library\DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory

 #include <Adafruit_Sensor.h>

                             ^

compilation terminated.

Multiple libraries were found for "DHT.h"
 Used: C:\Users\Mohamed\Documents\Arduino\libraries\DHT_sensor_library
 Not used: C:\Users\Mohamed\Documents\Arduino\libraries\arduino-DHT-master
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Don’t post screenshots of text! That is very unhelpful. When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

The information about multiple libraries is NOT an error. That is just some helpful information the Arduino IDE provides. If the intended library is being used then you have nothing to worry about.

The clue to the real error is that it says “fatal error”.

When you see a “No such file or directory” error it almost always means you need to install the library that contains the missing file.

Often the code you’re compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you’ll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE’s Library Manager:

  • Sketch > Include Library > Manage Libraries…
  • In the “Filter your search…” box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click “Install”.
  • Wait for installation to finish.
  • Click “Close”.
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add “arduino” as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you’ll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you’ll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

pert:
Don’t post screenshots of text! That is very unhelpful. When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

The information about multiple libraries is NOT an error. That is just some helpful information the Arduino IDE provides. If the intended library is being used then you have nothing to worry about.

The clue to the real error is that it says “fatal error”.

When you see a “No such file or directory” error it almost always means you need to install the library that contains the missing file.

Often the code you’re compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you’ll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE’s Library Manager:

  • Sketch > Include Library > Manage Libraries…
  • In the “Filter your search…” box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click “Install”.
  • Wait for installation to finish.
  • Click “Close”.
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add “arduino” as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you’ll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you’ll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

it is not compiling to the Arduino board

mohamedadawi: it is not compiling to the Arduino board

Did you install the missing library?

pert: Did you install the missing library?

yes

Post the error message that you get now.

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

Build options changed, rebuilding all
In file included from C:\Users\Mohamed\Documents\Arduino\dht_test\dht_test.ino:2:0:

C:\Users\Mohamed\Documents\Arduino\libraries\DHT_sensor_library/DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory

 #include <Adafruit_Sensor.h>

                             ^

compilation terminated.

Multiple libraries were found for "DHT.h"
 Used: C:\Users\Mohamed\Documents\Arduino\libraries\DHT_sensor_library
 Not used: C:\Users\Mohamed\Documents\Arduino\libraries\arduino-DHT-master
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So you did not install the library or installed it incorrectly.

In which directory is it on your PC?