Go Down

Topic: Sloeber - Symbol can not be resolved. (Read 499 times) previous topic - next topic

mprowe

Trying the standard Arduino BLINK sketch in my first investigation of Sloeber, I see that the basic Arduino IDE variables: "OUTPUT", "HIGH" & "LOW" are not recognised. However, the sketch will still compile & upload.

Is this expected?

Regards, Martin

PaulS

Quote
I see that the basic Arduino IDE variables: "OUTPUT", "HIGH" & "LOW" are not recognised.
OUTPUT, HIGH, and LOW are NOT variables.

Recognized how?
The art of getting good answers lies in asking good questions.

mprowe

Opps....   Incompetence?

Will the attached image illustrate my problem?

Regards, Martin

mprowe

Solved!

If I add this include, errors go away.

    #include </opt/sloeber/arduinoPlugin/packages/arduino/hardware/avr/1.6.15/cores/arduino/Arduino.h>

Then, with a bit more poking about.... use the drop-down menu Arduino | Reattach Libraries

(quite why/how a library becomes unattached, I don't know. But it must happen often enough for the author to add a menu option to fix it?)

Regards, Martin


Jantje

Why do you add the whole path an not just "Arduino.h"?
In stable version 3.1 the reattach libraries is still there just in case. Reattaching libraries is needed and happens automagically when you switch boards.
The stuff is far more complicated than it looks at first sight.
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

wjcarpenter

In the arduino IDE, and in all of the arduino code that you might get from somewhere else, that #include is not necessary. Obviously, it's just an annoyance to add it, so not too serious. Is there a plan to someday make that #include taken care of an invisibly? (Yes, I do appreciate that this stuff is complicated. Thanks for your work, Janje)

Jantje

In the arduino IDE, and in all of the arduino code that you might get from somewhere else, that #include is not necessary
Some remarks
1) The include is not necessary. The code compiles fine without it.
2) The Arduino IDE (I do not know about the others) do not offer the indexer functionality (Like write time code validation) that makes for the "need" to include Arduino.h.
3) Support for .ino files is there for 2 reasons. 1 to make the examples work and 2 to allow library developers to create examples.  .ino files is not my advised way to go.
4) This issue only exist if you have no arduino library includes at all. This because nearly all Arduino libraries include "Arduino.h". So it is only a minor inconvenience for simple example programs which is not the usage for Sloeber.
5) If I add #include Arduino.h to the code automagically some people will say Sloeber needs it and will complain about this.

So basically there is no way to win this for me.
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Go Up