user10017: I'm trying to convert a class header file from another c++ project to arduino, which in my mind involves replacing cout with Serial.println.
When I try to recomplile with all of these changes, I get this error from the compiler:
error: 'Serial' was not declared in this scope
     Serial.print(p[i]);

Can someone explain this to me?

user7508: You have to #include <Arduino.h>, or compile with the -include Arduino.h flag. The Arduino IDE normally does that for you, but you have to do it yourself if you are working outside the IDE.
There are a couple of Arduino Makefiles floating around the Web which, just like the IDE, take care of this for you.

10017: <p>I'm trying to convert a class header file from another c++ project to arduino, which in my mind involves replacing cout with Serial.println.</p>

<p>When I try to recomplile with all of these changes, I get this error from the compiler:</p>

<pre><code>error: 'Serial' was not declared in this scope
     Serial.print(p[i]);
</code></pre>

<p>Can someone explain this to me?</p>
 7508: <p>You have to <code>#include &lt;Arduino.h&gt;</code>, or compile with the <code>-include Arduino.h</code> flag. The Arduino IDE normally does that for you, but you have to do it yourself if you are working outside the IDE.</p>

<p>There are a couple of Arduino Makefiles floating around the Web which, just like the IDE, take care of this for you.</p>
