Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Arduino compiler can't find includes in sketch folder.

2 posters

Go down  Message [Page 1 of 1]

acebrian



With SimulIDE 0.5.15 rev 12 I get this error when trying to compile the "Piano_button.ino":

Piano_button:2:10: fatal error: pitches.h: No such file or directory

Attached compilation output log.


I checked that both .ino and .h files are copied from:

/home/devel/Test/Piano_button/

to build path:

/home/devel/.local/share/simulide/codeeditor/buildIno/Piano_button/

But, the AVR compiler doesn't find the header file in the build path.

May be and explicit include path in the AVR compiler command line will solve it?

-I /home/devel/.local/share/simulide/codeeditor/buildIno/Piano_button/


Best regards.
Attachments
Arduino compiler can't find includes in sketch folder. Attachmentcompile_log.txt
Compilation log
You don't have permission to download attachments.
(4 Kb) Downloaded 2 times



Last edited by arcachofo on Fri Dec 24, 2021 3:20 am; edited 1 time in total (Reason for editing : Marked as solved (green color))

arcachofo

arcachofo

It is working for me..

I believe that the problem is that original file:
/home/devel/Test/Piano_button/Piano_button.ino
is copied to:
/home/devel/.local/share/simulide/codeeditor/buildIno/Piano_button/Piano_button.ino
without companion header (.h) files. Therefore, AVR compiler doesn't find the header file in the build path.
All files in the folder containing .ino file are copied to the build folder:

Arduino compiler can't find includes in sketch folder. Piano10

Are you including Like this?:
#include "pitches.h"

If not it will search for a library.

acebrian



Yes, I use "" for include.

Arduino compiler can't find includes in sketch folder. Captur10



Last edited by acebrian on Sat Jan 09, 2021 4:17 pm; edited 1 time in total

acebrian



The problem is related to Arduino not to SimulIDE.

I have tried previous versions of Arduino:

- Arduino version <= 1.8.8 (that uses arduino-builder version <= 1.4.0) works right.

- Arduino version >= 1.8.9 (that uses arduino-builder version >= 1.4.4) doesn't find header file in .ino folder.

Best regards.

arcachofo

arcachofo

Yes... i was using an older Arduino version.

I modified simulide so it works with all versions now (hopefully).

Solved in rev 13.

acebrian



I confirm that it works right with all Arduino versions.

arcachofo wrote:Yes... i was using an older Arduino version.

I modified simulide so it works with all versions now (hopefully).

Solved in rev 13.

acebrian



I have detected that only built in libraries (located under "library" folder of the Arduino installation) are detected in compilation.

Libraries installed through the Arduino GUI are placed in the sketchbook folder and they are not detected.

Compilation command line shows:

-built-in-libraries /home/name/arduino-1.8.13/libraries

But it also needs:
-libraries /home/name/Arduino/libraries

The problem is that this implies reading the "preferences.txt" file to look for "sketchbook.path" variable value because the user can change the sketchbook path from Arduino GUI.

acebrian wrote:I confirm that it works right with all Arduino versions.

arcachofo wrote:Yes... i was using an older Arduino version.

I modified simulide so it works with all versions now (hopefully).

Solved in rev 13.

arcachofo

arcachofo

You are right.. there is still a problem here.

I will open a new discussion about Arduino compiling and move these post there.
Now it is buried here in this thread about Audio component, and maybe other people interested in this issue.

acebrian



Perhaps a simple solution should be to allow the user to configure the "Sketchbook path" in the same place where the "Arduino compiler path" is configured.

If the "Sketchbook path" variable is not empty then append the "-libraries" parameter to the compiler command line.


arcachofo wrote:You are right.. there is still a problem here.

I will open a new discussion about Arduino compiling and move these post there.
Now it is buried here in this thread about Audio component, and maybe other people interested in this issue.

arcachofo

arcachofo

Perhaps a simple solution should be to allow the user to configure the "Sketchbook path" in the same place where the "Arduino compiler path" is configured.

If the "Sketchbook path" variable is not empty then append the "-libraries" parameter to the compiler command line.
That would be the second option, but I think we can get user library path:
./arduino --get-pref sketchbook.path

I haven't get into this yet.
I'm working in the debugger (step by step execution) and re-writting a great part of Arduino section.
When i have this done i will add the user library stuff.

There is also plan to re-write evrything about compilers, with dialogs to edit settings, add compilers, etc.
So it could be options to add other library path and other editable options.

Now there is no place to do this, and "set compiler path" by clicking in document tab is more a workaraund than a proper solution.

acebrian



Totally agree, debugger (step by step execution) should be a priority.

arcachofo wrote:
Perhaps a simple solution should be to allow the user to configure the "Sketchbook path" in the same place where the "Arduino compiler path" is configured.

If the "Sketchbook path" variable is not empty then append the "-libraries" parameter to the compiler command line.
That would be the second option, but I think we can get user library path:
./arduino --get-pref sketchbook.path

I haven't get into this yet.
I'm working in the debugger (step by step execution) and re-writting a great part of Arduino section.
When i have this done i will add the user library stuff.

There is also plan to re-write evrything about compilers, with dialogs to edit settings, add compilers, etc.
So it could be options to add other library path and other editable options.

Now there is no place to do this, and "set compiler path" by clicking in document tab is more a workaraund than a proper solution.

arcachofo

arcachofo

Debugger should work after rev 21, still need some work for special cases and testing.
Inclusion of user libraries should work after rev 22 (Not tested in Windows).

acebrian



In my computer, 1000 ms wait is not enough to get sketchBook path.

Instead, 3000 ms works right.

Patch attached.

arcachofo wrote:Debugger should work after rev 21, still need some work for special cases and testing.
Inclusion of user libraries should work after rev 22 (Not tested in Windows).
Attachments
Arduino compiler can't find includes in sketch folder. Attachmentinodebugger.zip
Patch
You don't have permission to download attachments.
(1 Kb) Downloaded 2 times

arcachofo

arcachofo

In my computer, 1000 ms wait is not enough to get sketchBook path.

Instead, 3000 ms works right.

Patch attached.
Thanks, i will update it.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum