Library include error - Web IDE


#1

I added FastLED library to my project but the IDE does not find the file … why?

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

Every time I compile I get..
src/ledplo.cpp:2:21: fatal error: FastLED.h: No such file or directory
 #line 1

I tried also
#include <FastLED/FastLED.h> 
#include "FastLED.h"
#include "FastLED/FastLED.h"

nothing is working … why?


#2

@mutex, simply adding the #include is not enough. You need to attach the library to your application. Take a look here:

https://docs.particle.io/guide/getting-started/build/photon/#using-libraries


#3

Yes I did attach the FastLED library to my Application … i followed the guide.
IDE can’t find the include :frowning:

I tried with an official example
ds18b20-test.ino with included DS18B20 library
I got…

lib/DS18B20/src/DS18B20.h:4:21: fatal error: OneWire.h: No such file or directory
 #include <OneWire.h>

so I added OneWire library … same error


#4

You need to set the build target version to 0.6.2 (any 0.5.3+ should also work, but why stick with “buggy” versions?)


#5

Indeed this is making a big change :slight_smile:
Thank you!


#6

Thanks for the help guys!


#7

how does one change the build target version using the webide?

s


#8

@murmsk, take a look at the documentation:

https://docs.particle.io/guide/getting-started/build/photon/#flashing-your-first-app

The firmware version is selected as part of your target device selection :wink:


#9

I still get the error.

Even if I use the simplest of code

I started with a new app and added the libraries using the webide is get

lib/spark-dallas-temperature/spark-dallas-temperature.h:27:36: …/OneWire/OneWire.h: No such file or directory

system firmware 0.6.3

s


#10

@murmsk can you share your code? It sounds like you are missing a library.


#13

for some reason the include statements show when I cut and past but when it is uploaded they disappear???

there should be #include <spark-dallas-temperature.h> and #include .h there too


#14

@murmsk, you can create code blocks by placing triple backticks ``` before and after the code block. Place a blank line before and after code blocks to make the raw formatting easier to read.

 code goes here

#15

what is a backtick?


#16

On a US keyboard, it is the left-leaning quote usually found below the “tilde” or ~ symbol. It is also the “accent grave” in french.


#17

// This #include statement was automatically added by the Particle IDE.
#include <spark-dallas-temperature.h>

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

void setup() {

}

void loop() {

}

#18

I just edited this with the correct character–click the pencil edit icon to see how I did it.


#19

even something that simple throws the error

s


#20

thanks for holding my hand


#21

@murmsk, which device and firmware version are you targeting in the web IDE?


#22

@murmsk, I just confirmed the error and I’m not sure why this is cropping up now. @rickkas7, any thoughts? I test compiled on the IDE with various system firmware versions with the same results.