Is there some way to have two versions of the same library installed, distinguished of course by different names, such as a version suffix?
I'd have found this useful on several occasions, but the following is the one that prompted my post.
I have version 4.3.3, the latest, of 'IRremote' in IDE 1.8.19's Manage Libraries. That works for many sketches. But others fail because they were written years ago using version 2.x. There have been significant changes to the library since then. (Coinciding I think with its development and maintenance changing from Ken Shiriff to Armin Joachimsmeyer.)
Rather than having to downgrade/upgrade each time depending on the sketch, it would be good to just use the appropriate #include statement. In this case either #include <IRremote.h>
for the current version, or #include <IRremote_201.h>
for the version known to work with old sketches.
BTW, why does the github page accessed by using 'more info' from Manage Libraries for 'IRremote' risk ambiguity by heading it
'Arduino-IRremote'?
The library is called ‘IRremote’. But for some sketches the familiar #include statement must apparently now be replaced with this new ‘.hpp’ file. A fuller explanation under Using the new *.hpp files here:
If there is a compiler directive preventing the same file being loaded multiple times, correct the name there as well.
Make sure you keep the different versions in different folders.
If a Header file is included in a sketch, all .cpp files in that same folder will also be included. (i think that's what happens)
I'm struggling a bit at that level. Haven't given up, but may well elect to downgrading each time needed, then updating afterwards. Simpler and less risky.
Note correction: I believe the 'old' version should be 2.3.3, not 2.0.1.
If you have code that requires an old version of a library that will never change have you considered copying the library files to the sketch folder and explicitly #including the local version ?