Compile errors "No such file or directory" with any Arduino library

(deleted)

Why are you trying to use the system version of avr-gcc? I'm almost positive that's the source of your woes....

(deleted)

(deleted)

Perhaps if you're using the unofficial package manager version of the Arduino IDE that's true, but it's not so with the official Arduino software. The official Arduino software installs the specific version of avr-gcc specified by the author of the boards package, regardless of which operating system you're using.

(deleted)

VinzC:
First why would it be the compiler's responsibility to check where Arduino libraries are located?

I never claimed anything of the sort.

VinzC:
the IDE does pass the -I parameter.

Correct.

VinzC:
Do you mean Arduino developers have patched avr-gcc and changed its behaviour so as to work with Arduino libraries specifically?

Each Arduino boards platform developer can provide any arbitrary toolchain they like, so they are certainly welcome to provide patched compilers.

Arduino does use their own build of avr-gcc, which is patched. You can see them here:

but these patches aren't anything like what you're thinking of. There is no need to modify avr-gcc in this manner to make it work with Arduino libraries because they are standard C++/C/assembly.

VinzC:
Also on any Linux machine, the package manager installs avr-gccby default, not Arduino developers' selection. If it's the wrong choice, well, then a bug should be filed by all distributions package manager to reflect that very specific case.

I don't know much about the subject because I have enough on my plate supporting the official Arduino IDE without taking on 3rd party versions that have been modified in unspecified ways by, but it's my understanding that the package manager distributions are intentionally set up this way to avoid having multiple installations of the tools. That could be different depending on which package manager you're using.

Arduino's approach is different. They provide all the tools you need so there is no reliance on external resources. That might result in some additional disk space usage, but it also provides the most stable user experience, which is extremely important for the target Arduino user.

(deleted)

VinzC:
I'm just puzzled why focus on the compiler

The reason I'm focusing on the compiler is because I wanted to make sure to straighten out this statement:

VinzC:
Only on Windows does the Arduino install "its version" of avr-gcc.

VinzC:
Well, I have no idea what you think I'm thinking of :wink:

I quoted it right above that paragraph:

VinzC:
Do you mean Arduino developers have patched avr-gcc and changed its behaviour so as to work with Arduino libraries specifically?

VinzC:
I suppose so. I'm just puzzled why focus on the compiler whilit turns out the Arduino IDE downloads — and stores! — the whole avr-gcc package binaries under the user's profile (.arduino/packages/hardware/...)

It's under ~/.arduino15 when using IDE versions >1.0.x

It's not only avr-gcc. The toolchain of each boards platform you install will be stored under that location. So if you install Arduino SAMD Boards, you'll also have arm-none-eabi-gcc installed there, and so on.

VinzC:
To the question why use the system's compiler : I develop embedded applications and I like to control what tools are installed and where. I'm not alone in that regard.

...

why didn't Arduino developers use the system's avr-gcc instead since a) it's more recent (e.g. 9.3 on Gentoo*, 7.3 with Arduino) so their patches may have been incorporated along the way and b) it's also the distribution's maintainer's job to provide the right compiler and dependencies. I remember 3-4 years ago on Arch avr-gcc version was 7.something. It's a bit outdated on Linux Mint (5.4.0) and I have no idea what version Fedora and the like provide.

You answered your question. Each boards platforms are developed for a specific compiler version. Arduino is very cautious about updating the version because it can cause breakage. You may have multiple boards platforms installed each developed for its own version of the toolchain, in which case they will each install (if not already present) and use the version they specify.

Even though it is capable of supporting professional usages (and is certainly put to that sort of usage), the primary focus of the Arduino project is making embedded systems accessible to everyone. For this reason, stabiliity is given priority. A system that subjects the user to whatever random compiler version happens to be installed on their system at the momemt would not provide a friendly experience for beginners and casual users.

VinzC:
I know distribution maintainers and package managers expect from developers their dependency list (amongst other things of course). They need that to provide the best distribution-wise user experience, too. So it's not something to be ignored, IMHO.

Arduino doesn't use package managers. The packages you'll find are exclusively community projects with no official support from Arduino.

(deleted)