jbrazio / ardufocus

:telescope: The most accurate Open Source focus controller
https://ardufocus.com
GNU General Public License v3.0
52 stars 19 forks source link

Move sketch to appropriately named subfolder #2

Closed per1234 closed 6 years ago

per1234 commented 6 years ago

The Arduino IDE requires that a sketch be located in a folder of the same name. Although the name of the repository does match the sketch name, when GitHub's popular Clone or download > Download ZIP feature is used to download the contents of a repository the branch/release/commit name is appended to the folder name, causing a mismatch.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

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

After clicking "OK" the Arduino IDE currently moves only the file ardufocus.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

C:\Users\per\AppData\Local\Temp\cc9JQ6ev.ltrans0.ltrans.o: In function `main':

C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.207\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.207\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status
jbrazio commented 6 years ago

Thank you @per1234 for your contribution, this will be merged into the tree. BTW, kudos for the effort you dedicate to the Github community.