// This #include statement was automatically added by the Spark IDE.
#include "neopixel/neopixel.h"
PRODUCT_ID(1);
PRODUCT_VERSION(1);
And the full error:
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from neopixel/neopixel.h:53,
from neopixel/neopixel.cpp:50:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from neopixel/neopixel.cpp:50:0:
neopixel/neopixel.h: In constructor 'Adafruit_NeoPixel::Adafruit_NeoPixel(uint16_t, uint8_t, uint8_t)':
neopixel/neopixel.h:99:5: warning: 'Adafruit_NeoPixel::pixels' will be initialized after [-Wreorder]
*pixels; // Holds LED color values (3 bytes each)
^
neopixel/neopixel.h:95:5: warning: 'const uint8_t Adafruit_NeoPixel::type' [-Wreorder]
type; // Pixel type flag (400 vs 800 KHz)
^
neopixel/neopixel.cpp:65:1: warning: when initialized here [-Wreorder]
Adafruit_NeoPixel::Adafruit_NeoPixel(uint16_t n, uint8_t p, uint8_t t) :
^
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from neopixel_test.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
neopixel_test.cpp:4:11: error: expected constructor, destructor, or type conversion before '(' token
#line 1
^
neopixel_test.cpp:5:16: error: expected constructor, destructor, or type conversion before '(' token
^
make: *** [neopixel_test.o] Error 1
We are corresponding privately but wanted to put the answer here as well to ensure it is publicly visible. I was able to dig into your issue a bit more, and I was able to replicate the error that you were having. One important thing to keep in mind when compiling in the IDE is that the compile service will compile a binary for the device you currently have selected to flash to. When I have a Core selected, I am able to reproduce this error. When I have a Photon selected, the macros compile just fine. This should be working for both types of devices, but there may be an issue with the Core firmware compile service.
In your devices pane, can you select a Photon to flash to like below?
I notice that you’ve created a product that is built for the photon. If you already have a device that you added to the product, it will show up as an “Other” category in this pane, kind of like this:
Selecting a device like this should also work.
Does this make sense? Really hope we can get this resolved for you quickly.
Wondering if there’s a way to do this now. I’m trying to set PRODUCT_ID and PRODUCT_VERSION for my core device through the web IDE (build.particle.io).