Skip to content
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

Arduino IDE confuses *.h files with *.ino sketches #9562

Closed
aphcarios opened this issue Dec 27, 2019 · 5 comments
Closed

Arduino IDE confuses *.h files with *.ino sketches #9562

aphcarios opened this issue Dec 27, 2019 · 5 comments
Labels
Component: IDE The Arduino IDE Type: Bug Type: Duplicate Another item already exists for this topic

Comments

@aphcarios
Copy link

aphcarios commented Dec 27, 2019

I'm using arduino IDE version 1.8.10 it was working fine but suddenly with I open the project my headers files show up in the first tap of my project (See attached Image). this makes arduino IDE unable to compile the sketch correctly.
Arduino IDE Taps

I'm using vsCode as external editor with arduino plug. external editor is checked in the arduino IDE preferences. the project is also a git repository. the compile verbose shows the following:

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=10810 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\EEPROM\\src" "C:\\Users\\******\\AppData\\Local\\Temp\\arduino_build_869209\\sketch\\HW_config.h.cpp" -o nul
Alternatives for HW_config.h: []HotboxArduino:3:10: error: HW_config.h: No such file or directory

in my preferences file is says that my last sketch opened if ***.h file instead of header file.
Preferances txt

so far I tried the following:

1- creating new project whit *.ino file and *.h file ( worked) this mean the IDE does not get confused all the time.
2- creating new folder with sketch name (in the Desktop) and copy the projects file to is (Same issue)
3- removing the .git file (Same issue)
4- uninstalling and installing Arduino IDE (Same issue)
5- Manually editing preferences.txt (Same issue)
6- compiling with VSCode (Same issue)

could you please verify if this is a bug in the IDE ?? or if any one has similar issue

@aphcarios
Copy link
Author

renaming the sketch and its containing folder does not work either

@magedrifaat
Copy link
Contributor

Are you able to replicate this issue in a different sketch?

@aphcarios
Copy link
Author

I copied every thing to new sketch and to new location that worked for my
I'll try to clone the repository to new computer and see if this issue still comes out

@cmaglie
Copy link
Member

cmaglie commented Jan 29, 2020

Check that the containing folder name match the main .ino file: if your sketch is named MySketch.ino it must be in inside a folder named MySketch.

@per1234
Copy link
Collaborator

per1234 commented May 22, 2021

Thanks for taking the time to submit an issue @aphcarios .

I see we already have a prior issue report about this at #8030.

It's best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.

If you end up with additional information to share, feel free to comment in the other thread.

@per1234 per1234 closed this as completed May 22, 2021
@per1234 per1234 added the Type: Duplicate Another item already exists for this topic label May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE Type: Bug Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

No branches or pull requests

4 participants