MAC OS Sonoma 14.3.1 library location

Hello friends! I am new to Arduino and would like to know more about it. My OS is Sonoma 14.3.1. I have downloaded Arduino IDE 2.3.2. I would like to add custom libraries to it but could not find the folder Libraries. I would appreciate it if you could advise the location of the folder where I can save custom libraries. Many thanks in advance.

Welcome to the forum

If you look in the IDE File/Preferences you will see the path to your Sketchbook folder in case you don't know that

The Sketchbook folder should have a folder in it named libraries which is where custom libraries should be installed, each in their own folder

1 Like

Hello! Many thanks! Yes, I have seen this folder. So you are saying that files with extensions .cpp and .h can be added to this location?

As I said

A typical library will have a name such as myLibrary and will be in a folder in libraries named myLibrary. In that folder there will be files named myLibrary.h and myLibrary.cpp along with other files used by the library

As an extension of this the structure might look like this

The library files are then in the src folder and the examples of its use are un the examples folder

1 Like

after the installation of IDE, I have an Arduino folder in my Documents folder and it is empty

I have got folder with a custom code for TFT which is called SPFD5408-master. What I do, I copy this folder to my Documents/Arduino folder. After when I choose from File/Scetch menu any project:

it gives me error:

compilation terminated.
exit status 1
Compilation error: SPFD5408_Adafruit_GFX.h: No such file or directory

Create a directory called libraries as shown in the post by @UKHeliBob; note that the name is case sensitive.

Copy your custom library to the newly created libraries directory.

1 Like

Thank you! I was able to test some of them.

Thank you!

FYI, in cases where it is not possible to install a library using the IDE's "Library Manager" feature (which is the easiest way to install libraries), you can almost always use the "Add .ZIP Library..." feature to install the downloaded ZIP file of the library. Doing this will be easier than manually installing the library, and will also ensure that the library is installed correctly.

However, there are some libraries that must be installed manually due to the structure of the ZIP file not being compatible with the "Add .ZIP Library..." feature so knowing how to install libraries manually is definitely of value. The Library Manager and Add .ZIP Library... features also install the libraries to that same location, so knowing how to find this libraries folder is also valuable in cases where you want to take a look at the contents of a library either to understand how it works, perform troubleshooting, or make modifications.

1 Like

Many thanks for the heads-up!

1 Like

Is that what the Sketchbook folder location is set to in File/Preferences ?

1 Like

Yes

Then, as suggested, the libraries folder in which you create a folder for each library should be there. If it does not exist because no libraries have previously been added then create it manually

As a matter of interest, what is the name of the library that you want to install and what files does it consist of ? Did you write this library or have you found it online ?

Thanks for the advice.

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