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

Rename primary sketch file to match folder #3

Merged
merged 1 commit into from
Aug 22, 2021
Merged

Rename primary sketch file to match folder #3

merged 1 commit into from
Aug 22, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 21, 2021

Every Arduino sketch must contain a .ino file with name matching exactly to the sketch folder name. Previously, there was a case mismatch between the sketch file name "ebaghet.ino" and the folder name "eBaghet" (note the "b" vs. "B"). A case sensitive file system such as Linux is able to handle this just as any other name mismatch:

The file "ebaghet.ino" needs to be inside a sketch folder named "ebaghet".
Create this folder, move the file, and continue?

Unfortunately, if the user clicks the "OK" button, only the file "ebaghet.ino" is moved to the new matching folder, leaving behind all the sketch's other essential files:

eBaghet:30:10: fatal error: ebaghet_config.h: No such file or directory

  #include "ebaghet_config.h"
           ^~~~~~~~~~~~~~~~~~

The case mismatch results in an even more confusing situation on the case insensitive file systems of Windows and macOS (by default) due to a bug (arduino/Arduino#8030) in the Arduino IDE that causes the "Sample16.h" file to be renamed to "Sample16.h.cpp", resulting in a perplexing error:

ebaghet:32:10: fatal error: Sample16.h: No such file or directory

  #include "Sample16.h" // Sample template
          ^~~~~~~~~~~~

The solution is to rename the primary sketch file so that it matches the folder exactly.

Every Arduino sketch must contain a `.ino` file with name matching exactly to the sketch folder name. Previously, there was a case mismatch between the sketch file name "ebaghet.ino" and the folder name "eBaghet" (note the "b" vs. "B"). A case sensitive file system such as Linux is able to handle this just as any other name mismatch:

> The file "ebaghet.ino" needs to be inside a sketch folder named "ebaghet".
> Create this folder, move the file, and continue?

Unfortunately, if the user clicks the "OK" button, only the file "ebaghet.ino" is moved to the new matching folder, leaving behind all the sketch's other essential files:

```
eBaghet:30:10: fatal error: ebaghet_config.h: No such file or directory

  #include "ebaghet_config.h"
           ^~~~~~~~~~~~~~~~~~
```

The case mismatch results in an even more confusing situation on the case insensitive file systems of Windows and macOS (by default) due to a bug in the Arduino IDE that causes the "Sample16.h" file to be renamed to "Sample16.h.cpp", resulting in a perplexing error:

```
ebaghet:32:10: fatal error: Sample16.h: No such file or directory

  #include "Sample16.h" // Sample template
          ^~~~~~~~~~~~
```

The solution is to rename the primary sketch file so that it matches the folder exactly.
@Tinwelint78 Tinwelint78 merged commit a8c3da7 into Tinwelint78:master Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants