Library - No such file or directory error

My frustrations aside that yet another aspect doesn’t work when it used to.

I’m trying to include AssetTracker.h into my existing project (again) after it appears to have disappeared completely from the project itself.

Steps followed:

  1. Search for official library ‘AssetTracker’
  2. Click include in project
  3. Step through and click include
  4. Try to compile project, get the error that the .h file is missing

Please see screenshot

Is anyone else having this issue? Would really appreciate any guidance - it is preventing us from doing new builds.

PS: I have also tried the desktop Particle Dev app and have even more trouble with library inclusion.

2 Likes

Which system firmware version are you compiling against?

I have an issue with spark-dallas-temperature instead.

Compiles fine when it remove that library.

2 Likes

Strange, I just removed Spark-Dallas-Temperature by tricking Chrome into finally letting me click the remove button (left click, hold, right click hold, release buttons, wait for pop-up seemed to work).

That didn’t fix it, but what did fix it was:

  1. Create a new project file
  2. Add in the libraries
  3. Copy and past all code (exact same code)
  4. Compile
  5. Working

Unsure what is going on, I’m suspecting the upgrade from the ‘old project file format’ to the new one when libraries changed didn’t kick in correctly?

I am still having issues with OneWire reference in dallas-temp due to that folder in a folder reference, about to try fix that by manually copying the library in and adjusting that line (hopefully works…)

Thank you @kennethlimcp for helping to show it was working in another file - that gave me the idea to create a brand new project and try it again, which worked! While I avoided the problem and didn’t really ‘solve’ it - it at least helped me continue on.

1 Like

I also got the dallas temp library working which was good

Step 1. Remove OneWire & Dallas Temp libraries from left hand menu
Step 2. Add in files for the libraries manually at the top of the code screen (.cpp and .h files for both libraries) - see screenshot
Step 3. Copy and paste the library code into the files
Step 4. Edit the dallas temp file - circled in red in the attached screenshot.

The library pointing/referencing wasn’t playing nice, even removing the …/OneWire/OneWire.h and making it OneWire.h or …/OneWire.h didn’t work for me… meh :expressionless:

Hopefully this helps someone else :slight_smile:

Hi,

I’m having a similar issue adding the Adafruit_DHT. I add the lib through the IDE but when I compile I get the .h file missing error. I have tried adding in the files manually as suggested by @Cameron but that results in an ‘error saving firmware’.
Am I missing something?

here’s the code:

// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_DHT.h"


// DHT parameters
#define DHTPIN 5
#define DHTTYPE DHT11

// Variables
int temperature;
int humidity;
int light;

// Pins
int light_sensor_pin = A0;

// DHT sensor
DHT dht(DHTPIN, DHTTYPE);

void setup() {

// Start DHT sensor
dht.begin();

}

void loop() {

// Humidity measurement
temperature = dht.getTempCelcius();

// Humidity measurement
humidity = dht.getHumidity();

// Light level measurement
float light_measurement = analogRead(light_sensor_pin);
light = (int)(light_measurement/4096*100);

// Publish data
Spark.publish("temperature", String(temperature) + " °C");
delay(2000);
Spark.publish("humidity", String(humidity) + "%");
delay(2000);
Spark.publish("light", String(light) + "%");
delay(2000);

}

Ok so I made a new file with the library manually included and it now works.

Yeah - my solution was to create a new project and just copy it in manually.

I suspect something when wrong then converting from old format to new format… or something…

which works but becomes an issue when there are multiple nested libraries…in the end though the issue was that I was running old firmware, after updating to the newest version it works fine.

Just to confirm - this is still an issue with the Cloud IDE. The fix is as above - just make a new file, include the libraries and paste the code that didn’t work in the other file. This is definitely a Cloud IDE bug.

If anyone @Particle would like to have a look at it, there’s a link to my file that didn’t compile: https://go.particle.io/shared_apps/5dee33741eceeb000ae19b0f (no, that’s not mye real auth code…)

J