Multiple libraries were found for ... in EXAMPLE FILE

Hello!

I’ve been trying to use the ToneLibrary but couldn’t seem to be getting it working. So the only logical thing to do first, is google it up of course. It didn’t help me. The second thing I did, which made me realise it’s PROBABLY not my fault, is that I tried an example file from the library. When I compile it, I get this error:

Arduino: 1.8.10 (Windows 10), Board: “Arduino/Genuino Uno”
C:\Users\Alvin\Documents\Arduino\libraries\Tone\Tone.cpp:26:10: fatal error: wiring.h: No such file or directory
Multiple libraries were found for “Tone.h”
#include <wiring.h>
Used: C:\Users\Alvin\Documents\Arduino\libraries\Tone

  • ^~~~~~~~~~*
    compilation terminated.
    exit status 1
    Error compiling for board Arduino/Genuino Uno.
    at the line: '#include <Tone.h>

I installed the library by “Install ZIP library” in the Arduino IDE

I would appreciate some help. Thank you!

Nevermind! This library is from 2011 so it doesn’t really support Arduino 1. All you have to do, is go to ‘\Documents\Arduino\libraries\Tone’ and open Tone.cpp with a text editing program. Then change “#include <wiring.h>” to “#include <Arduino.h>” and everything will work.

Have a nice day!

Thanks for taking the time to post an update @TheMatrixAgent. I’m glad to hear you found the solution.

FYI, the “Multiple libraries were found for” message is just some helpful information the Arduino IDE provides. As you probably realized, the real error in this case was “wiring.h: No such file or directory”.

Generally, you can safely ignore the “Multiple libraries were found for” messages. The only time you need to pay attention to them is when the message show that a different library from the one you intended was used. In this case, there actually were no multiple libraries. There is a bug in Arduino IDE 1.8.10 that causes the “Multiple libraries were found for” messages to be displayed even when there are no multiple libraries. That bug has already been fixed, so it won’t be a problem when Arduino IDE 1.8.11 comes out. You’ll know the legitimate “Multiple libraries were found for” messages because they’ll show the path to the library that wasn’t used.

There is another IDE bug that is confusing matters even more. The “Multiple libraries were found for” message has ended up interlaced into the compiler error. The output should look like this:

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

C:\Users\Alvin\Documents\Arduino\libraries\Tone\Tone.cpp:26:10: fatal error: wiring.h: No such file or directory

 #include <wiring.h>
          ^~~~~~~~~~

Multiple libraries were found for "Tone.h"
 Used: C:\Users\Alvin\Documents\Arduino\libraries\Tone


compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.