Function to return custom Data Type

Actually you were closer to the mark than I ever thought.

If I embed the struct near the beginning of the sketch it compiles OK. Therefore the struct is OK. The problem is therefore to do with accessing the header file. REmoving the struct from the sketch allows me to check how the header file is accessed.

For the include I had, for example:

#include <mylib.h>

Changing this to:

#include "mylib.h"

solved the problem (mylib.h was in the same folder as the sketch, accessed through the secondary tab in the IDE).

Creating a copy of mylib.h and placing it inside the Arduino libraries folder also failed:

#include <mylib.h>

But then, saving, closing and re-opening the sketch gave no compile errors at all. I have noticed this before when first establishing libraries. Seems like the IDE needs a clean start.

Anyway... problem solved!

Ric