I have successfully removed an installed file from the libraries folder but the file is still showing in the libraries list. The problem now being when I try to download a file for the same name I get 'file with this name already exists'.
So how do I now remove a file that is not installed but still showing in the libraries list?
Hi @petercl14.
A library is a folder, not a file. Please delete the entire folder of the library.
Please be careful when deleting things from your computer. When in doubt, back up!
Perhaps rename the folder? Append ddmmyy and there's your backup!
Renaming the folder of a complete library will cause confusion for the IDE. I think the IDE will use the first directory that it finds that contains the file that matches the #include; if there are no files in the directory it's not an issue.
You are correct that it can cause problems, but the algorithm for deciding which library to use when multiple installed libraries contain a header file matching an #include directive is more sophisticated than that:
https://arduino.github.io/arduino-cli/latest/sketch-build-process/#dependency-resolution
Step 2 --- load the library that you haven't been able to...
sorry for calling it a file. To be more specific my question should have been 'how to delete unused libraries.' Even though I have uninstalled the library it is still in the unused libraries list and that is enough for Arduino to say there is already a library with this name.
I see that somebody has previously asked this same question without getting a reply.
Which list? Can you post a screenshot where you see it?
I have finally managed to get Hennig Karlsons excellent library for the DS3231 RTC. It is now in my sketches folder. Only one more problem. I cannot put it in the list of libraries. The reason being, apparently, there is a folder with the same name.
So I still need to know how to delete it from the libraries folder.
I would not delete it, put the library in the same folder as the sketch and change the #include <...> to #include"...". This way if you do not like it or some other program does not like it the original is still there.
I have merged your cross-posts @petercl14.
Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.
Here is a screenshot showing the ds3231. I need to get rid of so I can put in the library folder a folder with the same name.
No, you don't need to get rid of it in the library manager. And as far as I know, you can't even get rid of it.
You use Sketch /Include Library/Add .ZIP Library and point it to the zip file that you did download.
If a directory DS3231 (at the file system level) with that name already exists in the libraries directory, you will first have to delete that directory first; it's my understanding that by now you have deleted the directory, if not, do so.
Note:
Tested with the zip file downloaded from DS3231 - Rinky-Dink Electronics; if that's not the one that you're using, please provide a link.
or simply rename the folder to make it a backup
would an unzip of the desired library make a new folder as well?
As far as I can see, not quite. I did extract the zip and it has a subdirectory DS3231 in there which is the actual library. I named the zip RinkyDink_DS3231
$ tree -a RinkyDink_DS3231
RinkyDink_DS3231
└── DS3231
├── Documentation
│ ├── DS3231.pdf
│ └── version.txt
├── DS3231.cpp
├── DS3231.h
├── examples
│ ├── Arduino
│ │ ├── DS3231_Serial_Easy
│ │ │ └── DS3231_Serial_Easy.ino
│ │ ├── DS3231_Serial_Hard
│ │ │ └── DS3231_Serial_Hard.ino
│ │ ├── DS3231_Temperature
│ │ │ └── DS3231_Temperature.ino
│ │ └── DS3231_UnixTime
│ │ └── DS3231_UnixTime.ino
│ └── chipKit
│ ├── DS3231_Serial_Easy
│ │ └── DS3231_Serial_Easy.pde
│ ├── DS3231_Serial_Hard
│ │ └── DS3231_Serial_Hard.pde
│ ├── DS3231_Temperature
│ │ └── DS3231_Temperature.pde
│ └── DS3231_UnixTime
│ └── DS3231_UnixTime.pde
├── hardware
│ ├── arm
│ │ ├── HW_ARM_defines.h
│ │ └── HW_ARM.h
│ ├── avr
│ │ ├── HW_AVR_defines.h
│ │ └── HW_AVR.h
│ └── pic32
│ ├── HW_PIC32_defines.h
│ └── HW_PIC32.h
├── keywords.txt
└── License
├── License - CC BY-NC-SA 3.0 - Legal.pdf
└── License - CC BY-NC-SA 3.0 - Summary.pdf
When I installed the zip using the IDE, that subdirectory became the library directory.
$ tree -a libraries/DS3231/
libraries/DS3231/
├── Documentation
│ ├── DS3231.pdf
│ └── version.txt
├── DS3231.cpp
├── DS3231.h
├── examples
│ ├── Arduino
│ │ ├── DS3231_Serial_Easy
│ │ │ └── DS3231_Serial_Easy.ino
│ │ ├── DS3231_Serial_Hard
│ │ │ └── DS3231_Serial_Hard.ino
│ │ ├── DS3231_Temperature
│ │ │ └── DS3231_Temperature.ino
│ │ └── DS3231_UnixTime
│ │ └── DS3231_UnixTime.ino
│ └── chipKit
│ ├── DS3231_Serial_Easy
│ │ └── DS3231_Serial_Easy.pde
│ ├── DS3231_Serial_Hard
│ │ └── DS3231_Serial_Hard.pde
│ ├── DS3231_Temperature
│ │ └── DS3231_Temperature.pde
│ └── DS3231_UnixTime
│ └── DS3231_UnixTime.pde
├── hardware
│ ├── arm
│ │ ├── HW_ARM_defines.h
│ │ └── HW_ARM.h
│ ├── avr
│ │ ├── HW_AVR_defines.h
│ │ └── HW_AVR.h
│ └── pic32
│ ├── HW_PIC32_defines.h
│ └── HW_PIC32.h
├── keywords.txt
└── License
├── License - CC BY-NC-SA 3.0 - Legal.pdf
└── License - CC BY-NC-SA 3.0 - Summary.pdf
What I think should be renamed is the current folder with the unwanted lib files. The renamed folder is the backup.
And then unzip the wanted files in a folder that replaces the renamed folder, with the name that was renamed.
The old folder gets renamed and the new data unzips into the old name and the IDE uses the same name it did before only now it has the wanted contents and very important, no install process or new name if that can be gotten away with, i.e. Fool the IDE if possibooble.
That will not work reliably; see posts #4 and #5.
I created a copy of the DS3231 directory named DS3231_RinkyDink and modified the original .h and .cpp files in the original DS3231 directory. I did add a method called (public) test() in both the .h and the .cpp file of the original.
Next I did add a call to that method in one of the examples and compiled with success (the new method in the modified original DS3231 directory was recognised).
Detecting libraries used...
/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/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=10819 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/hardware/avr/1.8.6/variants/mega /tmp/arduino_build_828010/sketch/DS3231_UnixTime.ino.cpp -o /dev/null
Alternatives for DS3231.h: [DS3231 DS3231_RinkyDink]
ResolveLibrary(DS3231.h)
-> candidates: [DS3231 DS3231_RinkyDink]
...
...
Multiple libraries were found for "DS3231.h"
Used: /home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/libraries/DS3231
Not used: /home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/libraries/DS3231_RinkyDink
Using library DS3231 in folder: /home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/libraries/DS3231 (legacy)
Next I renamed the original DS3231 directory to zDS3231; I did not rename the .h or .cpp file. Compilation failed with the message that the new method was not recognised.
Detecting libraries used...
/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/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=10819 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/hardware/avr/1.8.6/variants/mega /tmp/arduino_build_475018/sketch/DS3231_UnixTime.ino.cpp -o /dev/null
Alternatives for DS3231.h: [zDS3231 DS3231_RinkyDink]
ResolveLibrary(DS3231.h)
-> candidates: [zDS3231 DS3231_RinkyDink]
...
...
Compiling sketch...
/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/packages/arduino/hardware/avr/1.8.6/variants/mega -I/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/libraries/DS3231_RinkyDink /tmp/arduino_build_978935/sketch/DS3231_UnixTime.ino.cpp -o /tmp/arduino_build_978935/sketch/DS3231_UnixTime.ino.cpp.o
/home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/forum.arduino.cc/1265878/DS3231_UnixTime/DS3231_UnixTime.ino: In function 'void setup()':
DS3231_UnixTime:57:7: error: 'class DS3231' has no member named 'test'
rtc.test();
^~~~
Multiple libraries were found for "DS3231.h"
Used: /home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/libraries/DS3231_RinkyDink
Not used: /home/wim/Downloads/1_arduino_ide_1.x/arduino-1.8.19/portable/sketchbook/libraries/zDS3231
Note:
If you rename the .h file as well it might work (not tested). But in that case you have to start keeping track of what is in the 'backup'.
You don't understand what I mean. I must not have written correctly.
What the IDE does is use a folder with incorrect data.
A folder with the same name but correct data might or might not work. It depends on what the IDE does with the data, if it uses the data every time or compiles something else that it uses.
I indeed do not seem to understand what you mean (and after post #18 I still don't). I gave a demonstration what can possibly go wrong (the IDE picked the wrong library).
Step 1 --- How does the IDE pick the library?
Step 2 --- Does the IDE use the zipped files only or does the install change or add to them?
