Hello Guys,
Im not a native speaker, I hope my problem is understandable and someone can resolve my problem. I followed the Arduino UNO Tutorial for the ERIKA3 GH40 release, but getting error messages caused by missing includes (arduino.h)
I found out, that the include of the "Arduino.h" only works, if the Source File is a C Source File (not .cpp). But when I renaming it to .c, all C++ libaries stop working.
In Image 1. you can see the Error Messages.
In Image 2. you can see, that I set the Arduino Path in the OIL Settings.
In Image 3. you can see, that the Arduino Libaries are added under Path and Symbols (Project Settings, C/C++ General Setting)
I have noticed, that under Path and Symbols in the C/C++ General Setting only GNU C is listed under Languages. Isn't the GNU C++ missing and causing that problem?
Thank you for your Help!
Not including Arduino Libaries in .cpp Files
Moderator: paolo.gai
Not including Arduino Libaries in .cpp Files
- Attachments
-
- 3.PNG (36.21 KiB) Viewed 11237 times
-
- 2.PNG (53.06 KiB) Viewed 11237 times
-
- 1.PNG (68.87 KiB) Viewed 11237 times
Re: Not including Arduino Libaries in .cpp Files
Dear anonymous,
Note that the red errors in Eclipse are due to the fact that Eclipse does not have all the include paths. The code compiles also if Eclipse has a few red marks.
It seeems you installed arduino not in teh default directory, but should not be an issue.
Did you try to build the project? the error list you showed is the one of eclipse, not of the compilation execution.
Ciao,
PJ
Note that the red errors in Eclipse are due to the fact that Eclipse does not have all the include paths. The code compiles also if Eclipse has a few red marks.
It seeems you installed arduino not in teh default directory, but should not be an issue.
Did you try to build the project? the error list you showed is the one of eclipse, not of the compilation execution.
Ciao,
PJ
Re: Not including Arduino Libaries in .cpp Files
I can compile without errors, build the code and also flash it to the UNO and read the serial output through putty. But with all the errors and missing includes changing the template is a pain.
I also tried the VM Version and followed all the Instructions...got the same Errors. Do you have the GNU C++ Language under C/C++ General Settings/ Path and Symbols or just the GNU C like in my Picture?
I also tried the VM Version and followed all the Instructions...got the same Errors. Do you have the GNU C++ Language under C/C++ General Settings/ Path and Symbols or just the GNU C like in my Picture?
Re: Not including Arduino Libaries in .cpp Files
well... the image you posted has the Arduino SDK ponting to a workspace directory. The one I have is the location of the Arduino installation.
PJ
PJ
Re: Not including Arduino Libaries in .cpp Files
hi everyone.
let me exhume this post.
in fact the "unresolved inclusion" error don't appear in .c files, just in .cpp files.
someone know how do solve this, or how to add GNU C++ in the languages list?
do you have GNU C++ in your projects language as veysel89 asked?
the real problem is actually this:
let me exhume this post.
i've found the same problem, i've correctly set the path of arduino SDK but actually the problem seem due to the missing of GNU C++ in the project languages.veysel89 wrote: ↑Tue Jul 10, 2018 10:00 am
In Image 1. you can see the Error Messages.
In Image 2. you can see, that I set the Arduino Path in the OIL Settings.
In Image 3. you can see, that the Arduino Libaries are added under Path and Symbols (Project Settings, C/C++ General Setting)
I have noticed, that under Path and Symbols in the C/C++ General Setting only GNU C is listed under Languages. Isn't the GNU C++ missing and causing that problem?
Thank you for your Help!
in fact the "unresolved inclusion" error don't appear in .c files, just in .cpp files.
someone know how do solve this, or how to add GNU C++ in the languages list?
do you have GNU C++ in your projects language as veysel89 asked?
the real problem is actually this:
Re: Not including Arduino Libaries in .cpp Files
Let me better understand...
1- when you compile the system builds the executable and you are able to flash it (which means the system works)
2- the issue is more related to the fact that the Eclipse CDT does not find all the includes you are using, neither the official Arduino ones, so the editor signals "false positive"s errors (Note that this point will not be corrected in the short term unfortunately, it highly depend on the toolchain)
Is this analysis correct?
PJ
1- when you compile the system builds the executable and you are able to flash it (which means the system works)
2- the issue is more related to the fact that the Eclipse CDT does not find all the includes you are using, neither the official Arduino ones, so the editor signals "false positive"s errors (Note that this point will not be corrected in the short term unfortunately, it highly depend on the toolchain)
Is this analysis correct?
PJ