FastLED Library not compiling

The FastLED library isn't compiling. Neither FastLED or FastLED2. I have tried on multiple accounts, with stripped back code.

#include "FastLED.h"
FASTLED_USING_NAMESPACE;

#define NUM_LEDS 41
#define DATA_PIN 6
#define LED_TYPE NEOPIXEL
#define BRIGHTNESS 255

CRGB leds[NUM_LEDS];

void setup()
{
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

}

void loop()
{
for (int i = 0; i < NUM_LEDS; i++){
leds[i] = CRGB::HotPink;
}
FastLED.show();

}

Error log:

. ./wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of dependent type 'typename NSFastLED::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>::particle::globals'

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of '::'

error

../wiring/inc/spark_wiring_spi.h:269:46: expected ';' at end of member declaration

error

lib/FastLED/chipsets.h:17:6: 'mSPI' does not name a type

error

lib/FastLED/chipsets.h:19:22: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:20:21: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:23:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:30:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:40:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:56:3: 'mSPI' was not declared in this scope

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of dependent type 'typename NSFastLED::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>::particle::globals'

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of '::'

error

../wiring/inc/spark_wiring_spi.h:269:46: expected ';' at end of member declaration

error

lib/FastLED/chipsets.h:109:6: 'mSPI' does not name a type

error

lib/FastLED/chipsets.h:104:7: expected ';' before '::' token

error

lib/FastLED/chipsets.h:121:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:126:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:131:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:140:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:145:3: 'mSPI' was not declared in this scope

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of dependent type 'typename NSFastLED::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>::particle::globals'

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of '::'

error

../wiring/inc/spark_wiring_spi.h:269:46: expected ';' at end of member declaration

error

lib/FastLED/chipsets.h:166:6: 'mSPI' does not name a type

error

lib/FastLED/chipsets.h:172:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:178:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:186:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:192:3: 'mSPI' was not declared in this scope

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of dependent type 'typename NSFastLED::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>::particle::globals'

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of '::'

error

../wiring/inc/spark_wiring_spi.h:269:46: expected ';' at end of member declaration

error

lib/FastLED/chipsets.h:217:6: 'mSPI' does not name a type

error

lib/FastLED/chipsets.h:219:25: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:220:62: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:223:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:230:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:242:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:258:3: 'mSPI' was not declared in this scope

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of dependent type 'typename NSFastLED::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>::particle::globals'

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of '::'

error

../wiring/inc/spark_wiring_spi.h:269:46: expected ';' at end of member declaration

error

lib/FastLED/chipsets.h:300:6: 'mSPI' does not name a type

error

lib/FastLED/chipsets.h:302:25: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:306:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:313:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:325:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:341:3: 'mSPI' was not declared in this scope

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of dependent type 'typename NSFastLED::SPIOutput<DATA_PIN, CLOCK_PIN, SPI_SPEED>::particle::globals'

error

../wiring/inc/spark_wiring_spi.h:269:46: ISO C++ forbids declaration of 'instanceSpi' with no type [-fpermissive]

error

../wiring/inc/spark_wiring_spi.h:269:46: invalid use of '::'

error

../wiring/inc/spark_wiring_spi.h:269:46: expected ';' at end of member declaration

error

lib/FastLED/chipsets.h:383:6: 'mSPI' does not name a type

error

lib/FastLED/chipsets.h:387:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:399:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:403:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:418:3: 'mSPI' was not declared in this scope

error

lib/FastLED/chipsets.h:426:3: 'mSPI' was not declared in this scope

The same here. Tried it with code i haven’t changed for month’s and which compiled before without a problem.

Is this with 1.5.0? I would suggest you try with 1.4.4 instead. There have been changes in 1.5.0 for SPI.

Yes, sure it works with version 1.4.x. But when it works with version 1.4.4 it should work with version 1.5.0 as well shouldn’t it?

I have been finding some ‘issues’ with 1.5.0 - suggest you log a ticket with Particle. Something has gone wrong or at least is different in 1.5.0.

I reported this in:


If you’ve any additional information, please append them there…

Please don’t use Github for bug reports. We prefer that you submit all bug reports via support.particle.io.
support.particle.io is the only official way of submitting bugs.

Yes, the library is broken in DeviceOS 1.5, but still works in DeviceOS 1.4.4.

The library is maintained outside of Particle and will require changes to the library itself to work with DeviceOS 1.5
1.5 uses C++11 thread-safe static initialization for SPI, where 1.4.4 uses a global object which is prone to cause problems due to undefined global object constructor initialization order and if you have another global object that accesses that SPI object, it’s not guaranteed that by that point it’ll be initialized.

We are looking to see what we can do about this due to the wide installation base, but for the time being, 1.4.4 is the only option for the FastLED library.

2 Likes

Thank you for clarifying this. So i will stick to DeviceOS 1.4.4 with my handful of devices, until there is a solution for this.

1 Like

It look like this has been fixed with DeviceOS 1.5.1 - my code compiles again without errors and the corresponding issue on Github has been closed.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.