Release 2017.4.30 / Update 2017.6.18

if you failed to compile the “SKETCH” 2 Include the Library

There are differences in ‘#inlucde’ notation when using libraries in Arduino IDE.

I noticed it because I tried adding some new library to my old sketch and I got a compile error.

There are two way of writing ‘#include’ library on my sketch, “” and <>.

In ‘u8glib’ sample sketch, all ‘#include’ are written with “”. But ‘u8g2’ which is new version of are written in <>.

Honesty, I don’t write ‘#include’ usually, because it automatically written from pulldown menu, or I can copy and paste from sample sketch.

Incidentally, if you use it from menu, it will <>.

Certainly, I had gotten to lost sometimes “which to write?”, when make a sketch from blank. But in reality, they are compiled almost without any problems in either case.

Because of self study, I didn’t know that. Basically “I don’t care as long as it works well”. But in this case, I have to check it.

#includeの意味(C/C++)
Sorry it’s only in Japanese.

There is a site that is mentioned more specifically.

#include ディレクティブ (C/C++)
Sorry it’s only in Japanese.

In short, way of writing it makes difference how find the library.

The latest IDE version is 1.8.2(30/4/2017).
#include “U8glib.h” find the library by relative path
#include <U8glib.h> find the library from designated direction by IDE

For example, if you search for the name ‘Mariko’ from the family tree,

looking dad’s brother relatives from grandpa, then go to brother’s son, you can find cousin ‘Mariko’. That’s the way of “”.

On the other hands, <> has a rule that “Find name ‘Mariko’ from your fathers relatives”.

Proper example? I think.

 

Actually, I figured out this notation difference when searched for the cause after I got a compilation error once. But the error didn’t appear again. I think it is caused from temporary direction trouble.

I don’t know exact reason so far. But same problem may happen to you. If you failed to compile, changing the description of ‘#include’ could be help yours.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA


This site uses Akismet to reduce spam. Learn how your comment data is processed.