Skip to content

adding the path WHERE the compiler was searching for a include-file #11686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
StefanL38 opened this issue Oct 19, 2021 · 1 comment
Closed

adding the path WHERE the compiler was searching for a include-file #11686

StefanL38 opened this issue Oct 19, 2021 · 1 comment
Labels
Component: Compilation Related to compilation of Arduino sketches feature request A request to make an enhancement (not a bug fix)

Comments

@StefanL38
Copy link

Please read the Issues section of the Contributing Rules at the "Contributing" link to the right before submitting an issue report.
Hello Everybody,

You should add the path where the compiler was searching for an include-file to make it easy for users to find the real cause of an error "No such file or directory"

I wrote the explaining text here:
https://forum.arduino.cc/t/extending-compiler-error-message-no-such-file-or-directory-for-better-guiding-to-the-real-reason/916278

here is additional information
https://forum.arduino.cc/t/how-can-a-library-properties-file-cause-an-error-no-such-file-or-directory/916101

and this documents the pain I had to find the real reason starting at post #15
https://forum.arduino.cc/t/evolved-library-keyboard-emulator-for-german-keyboard-layout-old-title-printing-characters-that-have-a-multibyte-representation-to-a-keyboard-emulator-does-not-work-like-write/914779

best regards Stefan

@per1234
Copy link
Collaborator

per1234 commented Oct 19, 2021

Hi @StefanL38. Thanks for your suggestion. The problem is that there are many paths the library discovery system and compiler search for these files. The very nature of the error is such that there is no way to identify a single one of those locations to use in the error message. If they were all added to the error message it would become an unapproachable wall of cryptic text.

If you turn on the verbose output during compilation, you can get a general idea of the include search paths. Here you can see that even just the high level parent paths passed to arduino-builder via the -hardware, -tools, -built-in-libraries, -libraries, and -build-path flags are already a lot:

C:\program-files\arduino\ide\arduino-1.8.16\arduino-builder -dump-prefs -logger=machine -hardware C:\program-files\arduino\ide\arduino-1.8.16\hardware -hardware C:\Users\per\AppData\Local\Arduino15\packages -tools C:\program-files\arduino\ide\arduino-1.8.16\tools-builder -tools C:\program-files\arduino\ide\arduino-1.8.16\hardware\tools\avr -tools C:\Users\per\AppData\Local\Arduino15\packages -built-in-libraries C:\program-files\arduino\ide\arduino-1.8.16\libraries -libraries E:\deleteme\asdf\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10816 -build-path C:\Users\per\AppData\Local\Temp\arduino_build_322235 -warnings=all -build-cache C:\Users\per\AppData\Local\Temp\arduino_cache_634742 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\per\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\per\AppData\Local\Temp\arduino_modified_sketch_311573\sketch_oct19a.ino

You also have the paths passed to the compiler via -I flags in the compilation commands:

"C:\\Users\\per\\AppData\\Local\\Arduino15\\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=atmega328p -DF_CPU=16000000L -DARDUINO=10816 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\per\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\per\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\standard" "-IC:\\program-files\\arduino\\ide\\arduino-1.8.16\\libraries\\Servo\\src" "C:\\Users\\per\\AppData\\Local\\Temp\\arduino_build_322235\\sketch\\sketch_oct19a.ino.cpp" -o nul

but the library paths in those flags are the ones where a library was discovered, so you won't see all the paths where a library was not discovered.

So unfortunately I think it's not feasible to implement that.

@per1234 per1234 closed this as completed Oct 19, 2021
@per1234 per1234 added Component: Compilation Related to compilation of Arduino sketches feature request A request to make an enhancement (not a bug fix) labels Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Compilation Related to compilation of Arduino sketches feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

No branches or pull requests

2 participants