'xxxx' does not name a type
This is the most common library related error message and it means that the compiler could not find the library. This can be due to:
- Library is not Installed (see previous pages in this guide)
- Wrong Folder Location
- Wrong Folder Name
- Wrong Library Name
- Library Dependencies
- Forgot to Shutdown the IDE
See below for solutions to these problems.
Wrong Folder Location
The IDE will only find standard libraries and libraries
installed in the sketchbook Libraries folder.
It will not be able to find libraries installed elsewhere.
The Library folder must be at the top level of the Libraries
folder. If you put it in a sub-folder,
the IDE will not find it.
Note: Some third-party library repositories have different folder structures. You may need to re-arrange things to make sure that the library files are at the top level of the folder. WaveHC is one example of this. The actual library folder is a folder within the top-level repository folder.
Don't have a "Sketchbook" folder
It is there. But on a Windows or Mac/OSX machine it may not be named "Sketchbook". See the page titled "Where to Install your Libraries".
You must download and install the entire library. Do not omit or alter the names of any files
inside the library folder.
Wrong Folder Name
The IDE will not load files with certain characters in the
name. Unfortunately, it doesn’t like the
dashes in the zip files names generated by Github. When you unzip the file, rename the folder so
that it does not contain any ‘illegal’ characters. Simply replacing each dash (‘-‘) with and
underscore (‘_’) usually works.
Wrong Library Name
The name specified in the #include of your sketch must match
exactly (including capitalization!) the class name in the library. If it does not match exactly, the IDE will
not be able to find it. The example sketches included with the library will have the correct spelling. Just cut and paste from there to avoid typos.
If you have multiple versions of a library, the IDE will try
to load all of them. This will result in
compiler errors. It is not enough to
simply rename the library folder. It must
be moved outside of the sketchbook
Libraries folder so the IDE won’t try to load it.
Some Libraries are dependent on other libraries. For example, most of the Adafruit Graphic
Display libraries are dependent on the Adafruit GFX Library. You must have the GFX library installed to
use the dependent libraries.
Some libraries cannot be used directly. The GFX library is a good example of
this. It provides core graphics functionality
for many Adafruit displays, but cannot be used without the specific driver
library for that display.
Forget to shutdown the IDE
The IDE only searches for libraries at startup. You must shut down ALL instances of the IDE
and restart before it will recognize a newly installed library.