Inludin g libraries in Arduino IDE 2.0


I just installed arduino IDE 2.0 and I am having problems uploading libraries. I compiled a sketch and it says that the SD.h library is not found. This library does not appear for me in the library manager of the 2.0 version, so I tried to add the .ZIP library and I get an error too.
When I compile I get this error:

Using board 'mega' from platform in folder: C:\Users\Carlo\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Using core 'arduino' from platform in folder: C:\Users\Carlo\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Detecting libraries used...
"C:\\Users\\Carlo\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\\Users\\Carlo\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\Carlo\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\mega" "C:\\Users\\Carlo\\AppData\\Local\\Temp\\arduino-sketch-1AD3AAE47E7045F21F1ACFDE84250C21\\sketch\\RECEIVER_V1.3_GOOD.ino.cpp" -o nul
Alternatives for SD.h: []
  -> candidates: []
Compilation error: Error: 2 UNKNOWN: exit status 1

and when I try to upload the library I get this error:

Error: Request installZip failed with message: 2 UNKNOWN: library is not valid: missing header file "SD-master.h"

Any ideas how to solve this problem?

@evansg124, your topic has been moved to a more suitable location on the forum.

1 Like

Not all libraries are listed by default. Type SDfat into the library manager search bar. There are a few available for installation.



The classic Arduino IDE comes with a collection of generally useful libraries pre-installed, one of which is the SD library. For this reason, we are accustomed to having these libraries always available and you will find many instructions and tutorials (including official ones) that make this assumption. At the moment, Arduino IDE 2.x does not come with any libraries pre-installed, so you must install any library you need. Fortunately, Library Manager makes this easy to do.

In this case, the library you want is listed in Library Manager as "SD by Arduino, Sparkfun". The Arduino IDE 2.x Library Manager search capability is terrible, so you might need to spend a while trying different things before you find it in the search results. If not, then you can use the stable Arduino IDE 1.8.16 since Arduino IDE 2.x is only intended to be used for beta testing at this stage in its development. You will find that the SD library is pre-installed when you use Arduino IDE 1.8.16.