# Dallas Temperature library has onewire error?

**URL:** <https://community.particle.io/t/dallas-temperature-library-has-onewire-error/29994>\
**Category:** Troubleshooting\
**Created:** [February 25, 2017, 1:46am UTC](https://community.particle.io/t/dallas-temperature-library-has-onewire-error/29994 "2017-02-25T01:46:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven5456](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Steven5456](https://community.particle.io/u/Steven5456)\
**Post date:** [February 25, 2017, 1:46am UTC](https://community.particle.io/t/dallas-temperature-library-has-onewire-error/29994/1 "2017-02-25T01:46:43Z")

</div>

I’m just trying to include the dallas temperature library but it keep throwing an error about not being able to find the onewire library. This is very strange to me because the error is coming from the library itself, which I can’t edit.

Code:

```
 #include <OneWire.h>
 #include <spark-dallas-temperature.h> 

```

Errors:

```
In file included from /src/funguy_monitor.cpp:8:0:
lib/spark-dallas-temperature/src/spark-dallas-temperature.h:27:36: fatal error: ../OneWire/OneWire.h: No such file or directory
     #include "../OneWire/OneWire.h"
```

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [February 25, 2017, 7:22am UTC](https://community.particle.io/t/dallas-temperature-library-has-onewire-error/29994/2 "2017-02-25T07:22:07Z")

</div>

Do you build the firmware locally?  
it seems that the library you use (wich one?) looks for the h-file in directory OneWire, so try placing the library in a directory called OneWire.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 25, 2017, 9:28am UTC](https://community.particle.io/t/dallas-temperature-library-has-onewire-error/29994/3 "2017-02-25T09:28:33Z")

</div>

What’s the reason to use `Spark-Dallas-Temperature` instead of `DS18B20`?  
The latter is maintained more regularly and has been properly ported to the Libraries 2.0 structure.  
If you are using this with the Particle IDEs, the `OneWire` lib will be imported automatically as dependency.

---

<div class="post-metadata">

**Author:** ![kazi93](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kazi93/32/11806_2.png) [@kazi93](https://community.particle.io/u/kazi93)\
**Post date:** [February 26, 2017, 5:15pm UTC](https://community.particle.io/t/dallas-temperature-library-has-onewire-error/29994/4 "2017-02-26T17:15:06Z")

</div>

@Steven5456

Click add button on the right corner and copy paste \*.h and \*.cpp and modify #include “…/OneWire/OneWire.h” to #include “OneWire.h”
