Error Status 1 error compiling

Hi,

Can anyone explain when all examples that include <SPI.h> library work and this otherwise empty sketch throws this error? It is the same if I type the "#include" statement or cut and paste from a working sketch.

By the way just an empty sketch compiles ok.

void setup() {
// put your setup code here, to run once:
#include <SPI.h>
}

void loop() {
// put your main code here, to run repeatedly:

}

Why are you putting the include statement in a function? Can you show ONE example that does that?

Hi,

I'm Just dumb.

I didn't spot the examples were outside of the setup function.

The strange thing is I had other library "includes" within the setup function and they did not throw a compile error.