# \#include "Print.h" / Print.cpp support?

**URL:** <https://community.particle.io/t/include-print-h-print-cpp-support/1318>\
**Category:** uncategorized\
**Created:** [January 6, 2014, 9:15pm UTC](https://community.particle.io/t/include-print-h-print-cpp-support/1318 "2014-01-06T21:15:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![timb](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/timb/32/1913_2.png) [@timb](https://community.particle.io/u/timb)\
**Post date:** [January 6, 2014, 9:15pm UTC](https://community.particle.io/t/include-print-h-print-cpp-support/1318/1 "2014-01-06T21:15:04Z")

</div>

In my quest to get as many LCD and OLED displays working with the Spark Core as humanly possible, I’ve run into a bit of a roadblock. Normally, Arduino includes a _Print Class_. This is what makes stuff like _Serial.print_ and _Wire.println_ function. Essentially, you just add _: Print_ to your class constructor with a function for _write_ and boom, you’ve inherited all the functionality of _Print_. 😃

So, my issue here is that _#include “Print.h”_ is throwing a “Not Found” error, so one would assume it’s automatically included, sadly it’s clear my class is in no way extending anything.

So am I going to have to _port that as well_?! xD

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [January 6, 2014, 9:31pm UTC](https://community.particle.io/t/include-print-h-print-cpp-support/1318/2 "2014-01-06T21:31:08Z")

</div>

I’m porting the [brewpi](http://brewpi.com) arduino-based fermentation controller to spark - in the code there are several classes that extend Print. Although you don’t have to include “Print.h”, the Print class is already included for you as part of “application.h”.

---

<div class="post-metadata">

**Author:** ![timb](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/timb/32/1913_2.png) [@timb](https://community.particle.io/u/timb)\
**Post date:** [January 6, 2014, 9:39pm UTC](https://community.particle.io/t/include-print-h-print-cpp-support/1318/3 "2014-01-06T21:39:38Z")

</div>

See, that’s what I thought, but it’s not working right for me. Are you extending it the standard way, with a _virtual void write_ function, etc.?

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [January 7, 2014, 12:12am UTC](https://community.particle.io/t/include-print-h-print-cpp-support/1318/4 "2014-01-07T00:12:37Z")

</div>

The signature is

```
virtual size_t write(uint8_t data);

```

E.g.

```
class A : public Print
{
public:
    virtual size_t write(uint8_t) { return 1; }
};

A a;

```

Compiles fine.

---

<div class="post-metadata">

**Author:** ![timb](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/timb/32/1913_2.png) [@timb](https://community.particle.io/u/timb)\
**Post date:** [January 7, 2014, 12:47am UTC](https://community.particle.io/t/include-print-h-print-cpp-support/1318/5 "2014-01-07T00:47:59Z")

</div>

Ahh, looks like I missed a couple of _size\_t_ entries! It seems the search function is boned in Spark Build. _CMD-F_ doesn’t bring up the search bar, but you can still go through the _Find \> Find…_ menu, however it only searches the current **visible** code and nothing in the scroll buffer. ☹
