Skip to content

Weird errors when sketch name and directory name differ in capitalization only... #6402

Description

@WestfW

If you have a sketch in a directory whose name is different only in capitalization, the Arduino IDE will get confused about what type of file it is pre-processing.

See WestfW/OptiLoader#12

Duplicate by:

  1. Download optiLoader .zip from https://github.com/WestfW/OptiLoader and uncompress.

  2. This gives you a directory OptiLoader-master, which the Arduino IDE won't like. Rename it to just "OptiLoader" - now the IDE will NOT complain about needing to "move" the sketch into a matching directory. (Note that the capitalization is still different.)

  3. Try to compile ("Verify") - the IDE will apparently attempt to do .cpp-style pre-processing on the optiLoader.h file, resulting in an error:

/Applications/arduino/Arduino-1.8.2.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware -hardware /Applications/arduino/Arduino-1.8.2.app/Contents/Java/portable/packages -tools /Applications/arduino/Arduino-1.8.2.app/Contents/Java/tools-builder -tools /Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -tools /Applications/arduino/Arduino-1.8.2.app/Contents/Java/portable/packages -built-in-libraries /Applications/arduino/Arduino-1.8.2.app/Contents/Java/libraries -libraries /Applications/arduino/Arduino-1.8.2.app/Contents/Java/portable/sketchbook/libraries -fqbn=arduino:avr:uno -ide-version=10802 -build-path /var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_build_573999 -warnings=none -build-cache /var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_cache_401912 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -verbose /Volumes/Downloads/Downloads/OptiLoader/optiLoader.h

/Applications/arduino/Arduino-1.8.2.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware -hardware /Applications/arduino/Arduino-1.8.2.app/Contents/Java/portable/packages -tools /Applications/arduino/Arduino-1.8.2.app/Contents/Java/tools-builder -tools /Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -tools /Applications/arduino/Arduino-1.8.2.app/Contents/Java/portable/packages -built-in-libraries /Applications/arduino/Arduino-1.8.2.app/Contents/Java/libraries -libraries /Applications/arduino/Arduino-1.8.2.app/Contents/Java/portable/sketchbook/libraries -fqbn=arduino:avr:uno -ide-version=10802 -build-path /var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_build_573999 -warnings=none -build-cache /var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_cache_401912 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr -verbose /Volumes/Downloads/Downloads/OptiLoader/optiLoader.h

Using board 'uno' from platform in folder: /Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/arduino/avr

Using core 'arduino' from platform in folder: /Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/arduino/avr

Detecting libraries used...
"/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_build_573999/sketch/optiLoader.h.cpp" -o "/dev/null"

"/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/arduino/Arduino-1.8.2.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_build_573999/sketch/optiLoader.h.cpp" -o "/var/folders/jz/5yb8f2hr8xjcpf0059bsfz4r0000gn/T/arduino_build_573999/preproc/ctags_target_for_gcc_minus_e.cpp"

/Volumes/Downloads/Downloads/OptiLoader/optiLoader.ino:85:24: fatal error: optiLoader.h: No such file or directory
 #include "optiLoader.h"

Easiest fix is probably to fix the check where the IDE (incorrectly) thinks that the sketch name and directory name match...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type: Bugeditor-refactorRelated to the refactoring of the Arduino IDE's editor component

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions