Is the IDE 1.8.19 able to support multiple boards and libraries without conflicts?

I hope I’m posting this query in the right location (or that a moderator will move this) but after spending several days trying to compile someone else’s known-good code unsuccessfully.. I kept getting pre-compiler errors trying to find libraries it could not find, yet I could not install because another error I got was they were already installed .. Anyway I had to both uninstall the IDE and also delete all three locations all my prior projects libraries were also installed in too., and then reinstalling everything from scratch fixed all the pre-compiling and linking issues.
Hence my question: is it safer to set up multiple instances of the IDE and run each project and it’s unique board separately, or should the IDE be able to handle all these different board types and their unique libraries and macros simultaneously with out errors (as it appears to be able to support) ?
Over about 5 years I’ve needed to make minor mods and recompile 6 or so projects ( three were very large projects) using different non-Arduino board types and wonder if I should rebuild that merged environment within a single Arduino.exe. Installation again .. or Should I try to avoid recurrence of what appeared to me to be a library and board incompatibility issues ( tho I’m honestly not sure what caused them) by trying to keep each separate if that’s even possible?

You are referring to the situation we discussed and resolved here?:

Yes. If you want complete control over the environment of the project, including the IDE version, toolchain, boards platform, and libraries. This is the way to do it. In the professional world, some even go so far as to archive an entire laptop which contains the environment used to produce the production build, so that even the PC architecture and OS configuration are pinned.

However, there is a trade-off between stability and convenience. In a decade of working with Arduino, I have not found the need to do such a thing (even though I do carefully control the environment of PC application projects I work on). But for my Arduino projects I have usually been satisfied to simply fix the rare breakage that came with an update to some component. I think the same is true for the majority of the users.

I think if you are going to do it, then it should be on a per-project basis, and even then you might want to only do it for the more complex or sensitive projects. I don't think it makes sense to do it on a per-board basis.

When it comes to boards of different architectures (e.g., Uno vs an ESP32-based board), no. The Arduino build system already does a pretty good job of only recognizes the resources from the platform of the board you have selected in the Arduino IDE, so you will be unlikely to find that installing or updating one boards platform interferes with the other platforms.

As for boards of the same architecture (e.g., Uno vs Mega), I suppose that having an isolated IDE installation for each would avoid a problem where you needed one version of library to be used for the Uno and another version of that library to be used for the Mega. It is probably a very rare situation though.

Definitely. Many thousands of users are doing this successfully.

If you are talking about your other topic:

https://forum.arduino.cc/t/another-pre-compiler-cant-find-or-install-custom-library-issue/963107

I'm not convinced that was the problem. It seemed to be that the problem was caused by a very odd sketchbook location configuration you set, and nothing to do with conflicts between boards and libraries. A bad configuration will cause you problem even in an isolated environment.

Yep. Worst is the "lib there, but updated" problem (Adafruit is big offender is evolving their code via architecture changes.)

You CAN avoid the library issue altogether by putting the library code in your sketch project folder and isolating it from the \Arduino\libraries location.
The above creates a multi-tab'd project automatically. Edit the #include <filename.h> to read #include "filename.h" or "./filename.h"

Don't forget the preprocessor "may" not handle some function prototypes, but that is usually easily fixed. Newer IDE seem to deal with this rather better.

On successful project completion, Zip the sketch folder and capture all external library dependencies. If you unZip years later and get a compile error, you will know it us an issue with old vs new syntax or a more restrictive compiler rule.

MAX31855 library embedded in sketch folder.

Its not a case of should, it does.

I currently have connected to my laptop an Arduino DUE and an ATmega328P. Just a few minutes ago I was using a ATmega1284P and an ESP32CAM.

They all work, same IDE.

I currently have 49 boards platforms installed, all used by a single installation of the Arduino IDE. Works fine.

Yes, I am referring to that library error situation you helped me to resolve and yes I am worried about it coming back. Yes, we might have been able to isolate it to a root cause but it was just too frustrating at the time for me and for my grandson and I threw in the towel and did the reinstall from scratch which fixed it before you had a chance to nail it down. I think it might also be related to the manual copy/paste procedure I followed from the vendor which I used to install their libraries.

Is using the AddZip option always the safest way to install new custom libraries that aren’t internal or available within the Library manager?

Do you think my flipping to the RC2 and the web versions of the IDE to experiment with them may have caused it?

I’ve had somewhat similar issues before. And one where the code would compile ok but not run Unless I moved to a different Win10 laptop and then it loaded and also ran fine. This happened to be on a 4in1 DIY multi protocol module.. and yes I’ve been working with ESP32 and Mega code too and altho I’m far from being a professional programmer , as a hobbiest I’m hoping to learn enough to teach my grandkids how to create intro code and do some of these super cool projects without looking like an idiot.

Bottom line, since I’m. No pro.. I’ll keep rebuilding this IDE again, and adding stuff into this edition of my IDE. Cause it’s easy enough to rebuild all again from scratch if it starts acting up again now that with your help, I know how.

These are great tips..I’ll start saving and zipping up the sketch and the libraries it needs together. Thanks

Wow.. ok that says a lot .. and answers it.. I’ll try to do the same .. thanks .. jimS

Yes. Sketch > Include Library > Add .ZIP Library... will always install the library to the most correct location and with the correct structure that allows it to be recognized by the Arduino IDE.

The only problem is that this installation method requires that the ZIP file has the correct structure (library is in the root of the ZIP). You will sometimes find ZIP files where the library is in a subfolder and this will cause the installation to fail (but it will not cause any problems other than that).

Arduino IDE 1.x has a nice capability where you can use Sketch > Include Library > Add .ZIP Library... to install libraries from any arbitrary folder in addition to installing from ZIP files. So this means you can still use that installation method even when the ZIP file has the wrong structure simply by unzipping the file first and then selecting the library's folder in the installer dialog.

Unfortunately, Arduino IDE 2.x does not currently have this capability. With those IDE versions, Sketch > Include Library > Add .ZIP Library... only accepts ZIP files.

I don't think so.

Arduino IDE 2.x uses a completely different preferences storage, so a preference set in Arduino IDE 2.x will not affect the preferences set in 1.x, and vice versa.

The only use of your local storage by Arduino Web Editor is for the "Arduino Create Agent", which handles serial port detection and uploads. Even those files of the "Arduino Create Agent" are stored in a dedicated separate location. It should not be able to affect your local installation of the Arduino IDE, boards platforms, libraries, and sketches in any way.

Very cool!

I think that is the best approach. There is certainly a place and time for creating isolated environments, anywhere along the spectrum of paranoia between "throw the libraries in the sketch folder" and "store redundant laptops in fireproof safes in multiple locations", but I wouldn't go to those lengths preemptively, since it can add quite a bit of complexity.

Fantastic answers .. thank you so very much and for being there to help me sort this stuff out.. I hope it’s as rewarding to give such great advice as to receive it..
I’ve read thru a lot of Arduino project books and Instructables projects and watched dozens of videos .. and never encountered these topics .. I’m very thankful for this Arduino Forum and knowing Im able be able to get such expert help is a great comfort..

I also know tho that the more I learn about it, the more I’ll realize how little I really know about it..

And that if I don’t do it myself and struggle thru most of the hard spots, the bugs, errors and glitches.. I’ll never remember their solutions..

Thanks Again.
JimS

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