HTU21D.h not found error on Digistump Oak

Created and app with the following code using build.particle.io.

// This #include statement was automatically added by the Particle IDE.
#include <HTU21D.h>

void setup() {

}

void loop() {

}

When I click ‘Verify’. The following error occurs –

Checking library HTU21D...
Installing library HTU21D 0.1.0 to lib/HTU21D ...
Library HTU21D 0.1.0 installed.
HTU21D.ino
lib/HTU21D/examples/HTU21D/HTU21D.ino:1:20: fatal error: HTU21D.h: No such file or directory
 #include "HTU21D.h"
                    ^
compilation terminated.
makefile:121: recipe for target 'obj/HTU21D.cpp.o' failed
make: *** [obj/HTU21D.cpp.o] Error 1
mv: missing destination file operand after '/output/firmware.bin'
Try 'mv --help' for more information.

Common first question for issues like that: "What system version are you targeting with your build?"
It needs to be 0.5.3 or later

The device is a Digispark “Oak” running 1.0.6.

That would also have been a piece of information well suited in the original post (Update: Topic title was edited since)
I’m not familiar with these devices but is 1.0.6 the most recent version available?

Yes, it is the latest. I have also tried setting up a project with the CLI and ‘particle library add’ with the exact same error.

Try changing the include statement back to the old style

#include "HTU21D/HTU21D.h"

If that doesn’t help you could try the (i) icon below the library name in Web IDE and select an older version where the example sketch features that include style.

It seems to have that issue with any library I try to use. Furthermore, if I change my target to an Electron, it builds fine.

Let me take this over to the hardware side. I will follow up here with my findings.

I tried the ‘old-style’ include and both older versions of the library, with and without the old style include in my code. Same error.

OK, I am doing something wrong. The left-hand side of my build environment says –

Particle Apps
HTU21D
Test HTU21D library

Files
    htu21d.ino

Included libraries
    HTU21D (0.0.1)    

But when I verify, I get…

Installing library HTU21D 0.1.0 to lib/HTU21D ...
Library HTU21D 0.1.0 installed.

Shouldn’t the library version be 0.0.1?

In Web IDE you can chose what version you want to import

However, I'm also unable to build for Photon 0.5.2 or before with any version of this library.
Maybe @rickkas7 can chime in.

For the time being, in order to move on you could copy/paste the sources of the library into your project.
Here is how it's done in Web IDE
https://docs.particle.io/guide/getting-started/tinker

And here you can find the sources

The Digistump Oak doesn’t support the “new” (0.5.3 and later) library format so you’ll need to manually copy the files into your project and probably edit them a bit.

1 Like

Thank you ScruffR and rickkas. You confirmed it was, in fact, particular to the hardware and simple-enough workarounds are available.

2 Likes