DHT libraries question

If I have a DHT library for one sketch, and then another DHT library for a different sketch, Do I have to remove one or the other library for any reason. I have been looking on youtube for lcd humidity and temperature projects and the if code comes with a DHT library, then a nother project might have a different DHT library.

I ask because I am having a problem compiling a couple of similar sketches, as it shows me that there are other libaries not used.

Multiple libraries were found for "dht.h"
Used: /home/rob/Downloads/arduino-1.8.5/libraries/DHT
Not used: /home/rob/sketchbook/libraries/DHTLib

What should I do in a that sort of situation.


The “Multiple libraries” message is just some helpful information provided by the Arduino IDE. The message only indicates a problem if the library being used is not the one you intended to be used.

In that case, one possible solution would be to remove the unwanted library. However, in the case that you need that library for another sketch, that is not a great solution. It’s not clear to me that is actually the case in your situation. Ideally, you would find one DHT library that you like to work with and use that for all your sketches. If for some reason you really do need two DHT libraries then there are some other solutions and I can help you with that.

Used: /home/rob/Downloads/arduino-1.8.5/libraries/DHT

FYI, you should never install libraries to the Arduino IDE installation folder. The reason is that everything in that folder will be lost when you update to a new version of the Arduino IDE. You should always install libraries to the libraries subfolder of the sketchbook folder. When you use the Arduino IDE’s Sketch > Include Library > Manage Libraries or Sketch > Include Library > Add .ZIP Library to install a library it will be automatically installed to the correct location.

Thanks for the explanation, that's great, and I did have my doubts of libraies in the Arduino folder. I'll now remove them .