no include file errors?

Greetings all,

I'm new to the Arduino environment, and I'm having a bit of a problem understanding what is happening...

Specifically, handling include files inside a library. It does not seem possible to include "standard" include files inside one?

I.e., I create a class and want to reference the standard library Servo, and try to include Servo.h inside my .h file.

This does not work. I have to include it in the sketch program, before I include mine... Why is that?

Oh, and if I include a file that doesn't exist, there is no error message? No "file SrvDriver.h not found", etc, messages?

Thanks...

Jason

It is because the Arduino IDE uses the list of libraries included in the sketch to know what files to gather together to build the sketch. It can't look inside libraries for that information, only the sketch.

It can't look inside libraries for that information, only the sketch.

It could. It doesn't.

Hmmm.... Okay, I suppose I can see somewhat of a reason for that. Given that as a design requirement, for some reason.

But does that explain why I can put an include file in the sketch that doesn't exist, and not get an error?

Cheers!

jason

But does that explain why I can put an include file in the sketch that doesn't exist, and not get an error?

Flags can be set to tell the compiler to not output specific messages. The Arduino team has, wrongly in my opinion, set the flag to suppress missing include file errors, even though they are fatal.

Ah. Got it.

Sigh. Well, that explains it.

I agree Paul, not a good solution. I would never have expected even warnings to be suppressed, since I usually run as treat warnings as errors. But hey... Why else are there flags for that? Somebody must have wanted them. :}

Cheers!

Jason

Somebody must have wanted them.

Comparing a signed and an unsigned value generates a warning, without an explicit cast. There are times when neither variable involved can be changed, so the warning is a nuisance. Often, it gets turned off.

Anything that is more than a warning should NOT be turned off, in my opinion.

Huh.. I put in the explicit cast, so I don't have to scan through thousands (yes, I've seen programs that generate thousands of warnings in a full compile) looking for one warning that might or might not be significant. If you keep up with it, adding casts where needed doesn't take that long.

I don't have sympathy for people who turn off warnings and then complain they can't find a bug...

Cheers!

Jason