Can no longer build - out of the blue

I think there has been a change in the last couple of weeks with the command line build ?

I’m pretty sure I did a build within the last couple of weeks which built fine.
This is code I have been using for a year.

Anyway first thing I get a new error :

attempting to compile firmware 
Compile failed. Exiting.
firmware.cpp:2:28: fatal error: IntervalTiming.h: No such file or directory
 #include "application.h"
                        ^
compilation terminated.
make[1]: *** [../build/target/user/platform-6firmware.o] Error 1
make: *** [user] Error 2

I think that its complaining about my file paths. They are referenced correctly (relatively) in particle.include
and I just specify the filename only in firmware.ino
I think that no longer works, so I change all the file references in firmware.ino to specify full relative path.

Now I get :

Error loading command /usr/lib/node_modules/particle-cli/commands/SerialCommand.js Error: Module version mismatch. Expected 48, got 46.

Compiling code for p

Including:
/work/food_aversions/spark/indoor-air-quality-dashboard/firmware-oled/firmware.ino
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/smileys.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/IntervalTiming/IntervalTiming.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/IntervalTiming/IntervalTiming.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/HttpClient/HttpClient.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/HttpClient/HttpClient.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/ReadingSync/ReadingSync.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/ReadingSync/ReadingSync.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/RgbLedControl/RgbLedControl.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/RgbLedControl/RgbLedControl.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/DHT22/PietteTech_DHT.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/DHT22/PietteTech_DHT.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/SimpleEeprom/SimpleEeprom.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/SimpleEeprom/SimpleEeprom.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/SensorBase/SensorBase.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/SensorBase/SensorBase.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/TGS2602/TGS2602.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/TGS2602/TGS2602.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/Adafruit/Adafruit_SSD1306.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/Adafruit/Adafruit_SSD1306.h
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/Adafruit/Adafruit_GFX.cpp
/work/food_aversions/spark/indoor-air-quality-dashboard/libs/Adafruit/Adafruit_GFX.h
attempting to compile firmware 
Compile failed. Exiting.
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `dht_wrapper()':
firmware.cpp:108: undefined reference to `PietteTech_DHT::isrCallback()'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `calibrate(String)':
firmware.cpp:278: undefined reference to `ReadingSync::startCalibrating(int)'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `sample(String)':
firmware.cpp:283: undefined reference to `ReadingSync::startUserSampling(int)'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `set2602Calib(String)':
firmware.cpp:291: undefined reference to `SimpleEeprom::writeFloat(float, int)'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `read_dht22()':
firmware.cpp:249: undefined reference to `PietteTech_DHT::acquire()'
firmware.cpp:251: undefined reference to `PietteTech_DHT::acquiring()'
firmware.cpp:258: undefined reference to `PietteTech_DHT::getHumidity()'
firmware.cpp:259: undefined reference to `PietteTech_DHT::getCelsius()'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `setup':
firmware.cpp:78: undefined reference to `SimpleEeprom::readFloat(int)'
firmware.cpp:86: undefined reference to `Adafruit_SSD1306::begin(unsigned char, unsigned char)'
firmware.cpp:87: undefined reference to `Adafruit_SSD1306::display()'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `loop':
firmware.cpp:116: undefined reference to `ReadingSync::getStage(int)'
firmware.cpp:122: undefined reference to `SensorBase::startSampling(unsigned long)'
firmware.cpp:124: undefined reference to `SensorBase::isSamplingComplete()'
firmware.cpp:124: undefined reference to `SensorBase::isTimeToRead(unsigned long)'
firmware.cpp:127: undefined reference to `SensorBase::isSamplingComplete()'
firmware.cpp:129: undefined reference to `TGS2602::getSewerGasPercentage(float)'
firmware.cpp:134: undefined reference to `IntervalTiming::startIntervalTime(unsigned long)'
firmware.cpp:135: undefined reference to `Adafruit_SSD1306::clearDisplay()'
firmware.cpp:136: undefined reference to `Adafruit_GFX::setTextColor(unsigned short)'
firmware.cpp:138: undefined reference to `Adafruit_GFX::setTextSize(unsigned char)'
firmware.cpp:139: undefined reference to `Adafruit_GFX::setCursor(short, short)'
firmware.cpp:144: undefined reference to `Adafruit_GFX::setTextSize(unsigned char)'
firmware.cpp:145: undefined reference to `Adafruit_GFX::setCursor(short, short)'
firmware.cpp:150: undefined reference to `Adafruit_GFX::setTextSize(unsigned char)'
firmware.cpp:151: undefined reference to `Adafruit_GFX::setCursor(short, short)'
firmware.cpp:159: undefined reference to `Adafruit_GFX::drawBitmap(short, short, unsigned char const*, short, short, unsigned short)'
firmware.cpp:161: undefined reference to `Adafruit_SSD1306::display()'
firmware.cpp:163: undefined reference to `IntervalTiming::isIntervalTimeComplete(unsigned long)'
firmware.cpp:172: undefined reference to `ReadingSync::isFirstSamplingLoop()'
firmware.cpp:175: undefined reference to `SensorBase::isSamplingComplete()'
firmware.cpp:176: undefined reference to `TGS2602::getSewerGasPercentage(float)'
firmware.cpp:177: undefined reference to `ReadingSync::setSamplingComplete()'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `HttpClient::get(http_request_t&, http_response_t&)':
../libs/HttpClient/HttpClient.h:77: undefined reference to `HttpClient::request(http_request_t&, http_response_t&, http_header_t*, char const*)'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `loop':
firmware.cpp:209: undefined reference to `ReadingSync::setReadingSent()'
firmware.cpp:217: undefined reference to `SensorBase::startCalibrating()'
firmware.cpp:219: undefined reference to `TGS2602::calibrateInCleanAir(int)'
firmware.cpp:221: undefined reference to `ReadingSync::setCalibratingComplete()'
firmware.cpp:223: undefined reference to `SimpleEeprom::writeFloat(float, int)'
firmware.cpp:234: undefined reference to `ReadingSync::isFirstPreHeatLoop()'
firmware.cpp:244: undefined reference to `RgbLedControl::setLedColor(int, int, int, RgbLedControl::Color)'
firmware.cpp:125: undefined reference to `SensorBase::setAnalogRead(int, unsigned long)'
../../../build/target/user/platform-6/libuser.a(firmware.o): In function `__static_initialization_and_destruction_0':
firmware.cpp:55: undefined reference to `PietteTech_DHT::PietteTech_DHT(unsigned char, unsigned char, void (*)())'
firmware.cpp:64: undefined reference to `Adafruit_SSD1306::Adafruit_SSD1306(signed char)'
firmware.cpp:69: undefined reference to `HttpClient::HttpClient()'
collect2: error: ld returned 1 exit status
make: *** [60d405f5bdabade0c061b3fb68ccc595afbab70eed41bc204550108a8ec9.elf] Error 1

build failed

It looks like it might be related to node, I updated my node with :

Doesnt do anything different. Not sure what to try next.

It looks like your library files are in a sub folder. There’s some regression when it comes to flattening of those files in the recent CLI.

Can you try moving all the files into one folder and compile again?

Hi @kennethlimcp,
That worked - thanks.

I had to put 50 library files into the same directory. On the forum I read something about a plan to make builds more Arduino like.

Is this part of that change ? Will this be a permanent change ?

I guess you are not on Windows, since there was a regression in 1.13.0 which broke the sub-folder support for other OSs.
But that’s not what you’ll have to expect what Libraries v2.0 will bring.

Things will get a lot better - already seen it :wink:

1 Like