'Serial' was not declared in this scope

Hello, I’m getting the following error from a .cpp file I’m including from a library I’m writing:

‘Serial’ was not declared in this scope

I’m using the Arduino environment to compile, the library shows up in the import library menu and includes it fine. The file is called ServerTaskKernel.cpp and is structured as follows:

#include "ServerTaskKernel.h"

. . .

void ServerTaskKernel::loop_() {
. . .
      int command = Serial.read();

And my sketch which includes its header file is:

#include <Task.h>
#include <ServerTaskKernel.h>

#define SERIAL_SPEED  9600

const Task* TASKS[] {

ServerTaskKernel g_kernel(0, TASKS);

void setup() {

void loop() {

Is there an include file for Serial? I’m an experienced programmer, but new to Arduino. Somehow the Arduino environment doesn’t seem to be setting up the dependencies right? Any help is greatly appreciated.

Edit: I tried removing the includes and pasting all of the library code into the sketch into one file, and I didn’t get the error. So it has something to do with it being in a library, i.e., in external .h and .cpp files…

I found that I DO need an include for Serial and the other Arduino features:

include "WProgram.h"

Once I placed that in ServerTaskKernel, it didn't complain about Serial anymore. If I had referenced Serial in the header file, then I would have had to include WProgram.h there, but I only referenced it in my implementation file.

I guess I should have read the library creation tutorial earlier ::) http://www.arduino.cc/en/Hacking/LibraryTutorial