Libraries not being found after being installed

Hello, I was wondering if someone could assist with this issue.

So I recently have been working on a project sent to me by a friend. He originally created this program on the Arduino IDE, and I have been porting it over to a template I have been using on VSCode/PlatformIO. He never had issues when uploading his project, however, I had only a couple when moving them and their respective included libraries.

The issues were within an “EEPROM.h” file that my friend had used. I installed it straight from GitHub and added it to my project. I know I did this part correctly because I had to do it with other libraries and I had no issues.

When I found where the issue was coming from within the .h file, it was due to two include statements. These were named “avr/eeprom.h” and “avr/io.h”. The error is that the #included files can not be found. It seems as if these are folders or something. And when I was finding project locations, I would click down file rabbit holes and find different folder in different projects named avr.

What’s more confusing is that when I copy the program to Arduino IDE, and install the library, it does not give me any errors.

I can’t seem to find someone else with this issue. Can someone help?

There are many EEPROM.h libraries for different architectures / boards.

Please upload the exact project you’re having problems with compiling in PlatformIO, or a minimal version thereof.


These are some images of my issues. The first image shows the error in the main cpp file. And the second image is where I am brought when I find definition of the error from the main cpp file. When I hover over the error, they both say "cannot open source file ‘avr/____.h’ "

Is there any files that would help in figuring out the problem?

Also should have added that I am doing this on the Arduino DUE

You don’t have avr/eeprom.h on a Due. That’s for Atmel AVR chips only (Arduino Uno, Arduino Mega, …). A Due is a Atmel SAM3X chip.

There are however alternative EEPROM libraries that use flash reprogramming to emulate EEPROM: GitHub - sebnil/DueFlashStorage: DueFlashStorage saves non-volatile data for Arduino Due. The library is made to be similar to the EEPROM library.

2 Likes

Awesome. That’s all I needed to know, for now… haha. But I appreciate the quick and easy response. I get/see a lot of sarcasm on these types of sites. You made my day better.

1 Like