CLI Compile Fails

Continuing the discussion from [Dev Compile Works, CLI Compile Fails (FastLED?)]

After updating CLI I have the same problem as plasticrake:
Every project using subfolders won't compile.

Any Ideas?

Regard,
Marcus

(Dev Compile Works, CLI Compile Fails (FastLED?)):

One Example: The first try fails and if I copy everything into one directory compile does its job successfully.

iMac27Retina:TestHDC100x marcus$ ll
total 224
-rw-r--r--  1 marcus  staff   1447 26 Feb 12:39 HDC1000test.ino
-rw-r--r--  1 marcus  staff  83564 26 Feb 12:22 core_firmware.bin
-rw-r--r--  1 marcus  staff   8036  2 Apr 09:14 p1_firmware.bin
-rw-r--r--  1 marcus  staff     16 26 Feb 11:25 particle.exclude
iMac27Retina:TestHDC100x marcus$ particle compile p HDC1000test.ino ../Adafruit_HDC1000/firmware/Adafruit_HDC1000.h ../Adafruit_HDC1000/firmware/Adafruit_HDC1000.cpp 

Compiling code for p

Including:
    HDC1000test.ino
    ../Adafruit_HDC1000/firmware/Adafruit_HDC1000.h
    ../Adafruit_HDC1000/firmware/Adafruit_HDC1000.cpp
attempting to compile firmware 
Compile failed. Exiting.

iMac27Retina:TestHDC100x marcus$ cd ../pathtest/
iMac27Retina:pathtest marcus$ ll
total 56
-rw-r--r--  1 marcus  staff  4528 26 Jun 21:12 Adafruit_HDC1000.cpp
-rw-r--r--  1 marcus  staff  2223 26 Jun 21:11 Adafruit_HDC1000.h
-rw-r--r--  1 marcus  staff  1447 26 Jun 21:09 HDC1000test.ino
-rw-r--r--  1 marcus  staff  8916 26 Jun 21:12 p_firmware_1466968348017.bin
iMac27Retina:pathtest marcus$ particle compile p HDC1000test.ino Adafruit_HDC1000.h Adafruit_HDC1000.cpp 

Compiling code for p

Including:
    HDC1000test.ino
    Adafruit_HDC1000.h
    Adafruit_HDC1000.cpp
attempting to compile firmware 
downloading binary from: /v1/binaries/57702af34cea010b2325f50e
saving to: p_firmware_1466968817757.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
   8908	      8	    624	   9540	   2544	
Compile succeeded.
Saved firmware to: /Users/marcus/Development/Particle/pathtest/p_firmware_1466968817757.bin
iMac27Retina:pathtest marcus$

This is an issue that is already investigated but happens only with some setups, so any input about your system helps.
Could you try putting the files back in the original places and add a ._*.* line for each subdirectory to the particle.ignore file (not particle.exclude)

OK, tried to define an ignore file but without success:

iMac27Retina:TestHDC100x marcus$ ll
total 32
-rw-r--r--  1 marcus  staff  1447 26 Feb 12:39 HDC1000test.ino
-rw-r--r--  1 marcus  staff    16 26 Feb 11:25 particle.exclude
-rw-r--r--  1 marcus  staff     6 26 Jun 21:47 particle.ignore
-rw-r--r--  1 marcus  staff   135 26 Feb 11:55 particle.include

iMac27Retina:TestHDC100x marcus$ cat particle.include 
# particle.include

../Adafruit_HDC1000/firmware/Adafruit_HDC1000.cpp
../Adafruit_HDC1000/firmware/Adafruit_HDC1000.h

HDC1000test.ino

iMac27Retina:TestHDC100x marcus$ cat particle.exclude 
.DS_Store
*.bin

iMac27Retina:TestHDC100x marcus$ cat particle.ignore 
._*.*

iMac27Retina:TestHDC100x marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/Adafruit_HDC1000/firmware/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/Adafruit_HDC1000/firmware/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/TestHDC100x/HDC1000test.ino
attempting to compile firmware 
Compile failed. Exiting.

I'm using an iMac with OS X 10.11.5 and Particle-CLI 1.14.2

Which information can I provide to help you with my problem?

Regards,
Marcus

That might be something for @jvanier to answer - I think he's in charge of CLI and has seen the issue linked above already.

Glanced quickly and it seems like it fails if the other files are outside of the directory that the .ino file exist

That might be true for that system but is not for all systems - on my Windows machines (8.1 & 10) it works, @BDub reported it working on his Mac and AFAIR a Linux VM.
1.14.2 should build with subdirectories as long the include statements are kept as if it was a flat project directory - but even if they weren't you'd still get a more elaborate error output.

@MaxSharx BTW:

I meant it as I wrote it

each subdirectory, not only the project base - more like this

./._*.*
./FastLED/._*.*
./WhateEverElse/._*.*
...

and remove any not needed subfolders and extra .ino just to be safe - or add them to particle.ignore too.

Ohh, didn't saw the "each". Now, I've tried the following:

iMac27Retina:pathtest marcus$ ls -la ../Adafruit_Lib/
total 24
drwxr-xr-x   5 marcus  staff   170 27 Jun 21:32 .
drwxr-xr-x  31 marcus  staff  1054 27 Jun 21:14 ..
-rw-r--r--   1 marcus  staff  4528 26 Jun 21:12 Adafruit_HDC1000.cpp
-rw-r--r--   1 marcus  staff  2223 26 Jun 21:11 Adafruit_HDC1000.h
drwxr-xr-x   2 marcus  staff    68 27 Jun 21:32 firmware
iMac27Retina:pathtest marcus$ ls -la
total 24
drwxr-xr-x   5 marcus  staff   170 27 Jun 21:37 .
drwxr-xr-x  31 marcus  staff  1054 27 Jun 21:14 ..
-rw-r--r--   1 marcus  staff  1447 27 Jun 21:23 HDC1000test.ino
-rw-r--r--   1 marcus  staff    37 27 Jun 21:38 particle.ignore
-rw-r--r--   1 marcus  staff   200 27 Jun 21:32 particle.include
iMac27Retina:pathtest marcus$ cat particle.include 
# particle.include

../Adafruit_Lib/Adafruit_HDC1000.cpp
../Adafruit_Lib/Adafruit_HDC1000.h

HDC1000test.ino
iMac27Retina:pathtest marcus$ cat particle.ignore 
../Adafruit_Lib/._*.*
../._*.*
._*.*
iMac27Retina:pathtest marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/Adafruit_Lib/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/Adafruit_Lib/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/pathtest/HDC1000test.ino
attempting to compile firmware 
Compile failed. Exiting.
HDC1000test.cpp:13:30: fatal error: Adafruit_HDC1000.h: No such file or directory
 void setup();
                              ^
compilation terminated.
make[1]: *** [../build/target/user/platform-8HDC1000test.o] Error 1
make: *** [user] Error 2

Please be aware that the two directories are on the same level. "Adafruit_Lib" isn't a subdirectory.
If I put the library files into that "firmware" directory one step deeper under "Adafruit_Lib" I get:

iMac27Retina:pathtest marcus$ ls -la ../Adafruit_Lib/firmware
total 24
drwxr-xr-x  4 marcus  staff   136 27 Jun 21:47 .
drwxr-xr-x  3 marcus  staff   102 27 Jun 21:47 ..
-rw-r--r--  1 marcus  staff  4528 26 Jun 21:12 Adafruit_HDC1000.cpp
-rw-r--r--  1 marcus  staff  2223 26 Jun 21:11 Adafruit_HDC1000.h
iMac27Retina:pathtest marcus$ ls -la ../Adafruit_Lib
total 0
drwxr-xr-x   3 marcus  staff   102 27 Jun 21:47 .
drwxr-xr-x  31 marcus  staff  1054 27 Jun 21:14 ..
drwxr-xr-x   4 marcus  staff   136 27 Jun 21:47 firmware
iMac27Retina:pathtest marcus$ ls -la
total 24
drwxr-xr-x   5 marcus  staff   170 27 Jun 21:37 .
drwxr-xr-x  31 marcus  staff  1054 27 Jun 21:14 ..
-rw-r--r--   1 marcus  staff  1447 27 Jun 21:23 HDC1000test.ino
-rw-r--r--   1 marcus  staff    68 27 Jun 21:47 particle.ignore
-rw-r--r--   1 marcus  staff   127 27 Jun 21:48 particle.include
iMac27Retina:pathtest marcus$ cat particle.include 
# particle.include

../Adafruit_Lib/firmware/Adafruit_HDC1000.cpp
../Adafruit_Lib/firmware/Adafruit_HDC1000.h

HDC1000test.ino
iMac27Retina:pathtest marcus$ cat particle.ignore 
../Adafruit_Lib/firmware/._*.*
../Adafruit_Lib/._*.*
../._*.*
._*.*
iMac27Retina:pathtest marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/Adafruit_Lib/firmware/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/Adafruit_Lib/firmware/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/pathtest/HDC1000test.ino
attempting to compile firmware 
Compile failed. Exiting.

Putting it all together into one directory structure will produce this:

iMac27Retina:pathtest marcus$ ls -la
total 24
drwxr-xr-x   6 marcus  staff   204 27 Jun 21:52 .
drwxr-xr-x  30 marcus  staff  1020 27 Jun 21:52 ..
drwxr-xr-x   4 marcus  staff   136 27 Jun 21:52 Adafruit_Lib
-rw-r--r--   1 marcus  staff  1447 27 Jun 21:23 HDC1000test.ino
-rw-r--r--   1 marcus  staff    68 27 Jun 21:47 particle.ignore
-rw-r--r--   1 marcus  staff   107 27 Jun 21:51 particle.include
iMac27Retina:pathtest marcus$ ls -la Adafruit_Lib/
total 24
drwxr-xr-x  4 marcus  staff   136 27 Jun 21:52 .
drwxr-xr-x  6 marcus  staff   204 27 Jun 21:52 ..
-rw-r--r--  1 marcus  staff  4528 26 Jun 21:12 Adafruit_HDC1000.cpp
-rw-r--r--  1 marcus  staff  2223 26 Jun 21:11 Adafruit_HDC1000.h
iMac27Retina:pathtest marcus$ cat particle.include 
# particle.include

./Adafruit_Lib/Adafruit_HDC1000.cpp
./Adafruit_Lib/Adafruit_HDC1000.h

HDC1000test.ino
iMac27Retina:pathtest marcus$ cat particle.ignore 
../Adafruit_Lib/firmware/._*.*
../Adafruit_Lib/._*.*
../._*.*
._*.*
iMac27Retina:pathtest marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/pathtest/Adafruit_Lib/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/pathtest/Adafruit_Lib/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/pathtest/HDC1000test.ino
    /Users/marcus/Development/Particle/pathtest/Adafruit_Lib/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/pathtest/Adafruit_Lib/Adafruit_HDC1000.cpp
attempting to compile firmware 
Compile failed. Exiting.
HDC1000test.cpp:13:30: fatal error: Adafruit_HDC1000.h: No such file or directory
 void setup();
                              ^
compilation terminated.
make[1]: *** [../build/target/user/platform-8HDC1000test.o] Error 1
make: *** [user] Error 2

As you can see, there aren't any other not needed files.

Hi Max,

Compiling with files in relative folders is what’s causing the issue.

Are you able to compile a project that has subfolders and only source files in those subfolders? For example:

HDC1000test.ino <-- in this file use #include "Adafruit_HDC1000/Adafruit_HDC1000.h"
Adafruit_HDC1000/Adafruit_HDC1000.cpp
Adafruit_HDC1000/Adafruit_HDC1000.h

You can compile that with particle compile p1 .

Yes, that works if I change the include directive, with a subdirectory in the same directory hierarchy, and delete particle.include. But, that isn’t really an option for me because I use a bunch of git repos etc. My working directory only contains a config file for a distinct hardware variant. And everything is included from there via the particle.include file. Have a look:

iMac27Retina:RoomGuard_TFT_P1 marcus$ ll
total 96
-rw-r--r--  1 marcus  staff    922 26 Jun 20:35 RoomGuard_Features.h
-rw-r--r--  1 marcus  staff  35988  1 Mai 23:54 p1_firmware.bin
-rw-r--r--  1 marcus  staff     38 26 Jun 22:44 particle.ignore
-rw-r--r--  1 marcus  staff   1136 30 Apr 22:57 particle.include
iMac27Retina:RoomGuard_TFT_P1 marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/Adafruit_ILI9341/firmware/Adafruit_ILI9341.cpp
    /Users/marcus/Development/Particle/Adafruit_ILI9341/firmware/Adafruit_ILI9341.h
    /Users/marcus/Development/Particle/Adafruit_mfGFX_IDE/firmware/Adafruit_mfGFX.cpp
    /Users/marcus/Development/Particle/Adafruit_mfGFX_IDE/firmware/fonts.cpp
    /Users/marcus/Development/Particle/Adafruit_mfGFX_IDE/firmware/Adafruit_mfGFX.h
    /Users/marcus/Development/Particle/Adafruit_mfGFX_IDE/firmware/fonts.h
    /Users/marcus/Development/Particle/Adafruit_FT6206/firmware/Adafruit_FT6206.cpp
    /Users/marcus/Development/Particle/Adafruit_FT6206/firmware/Adafruit_FT6206.h
    /Users/marcus/Development/Particle/Metro-Arduino-Spark-Wiring/firmware/Metro-Arduino-Spark-Wiring.h
    /Users/marcus/Development/Particle/Metro-Arduino-Spark-Wiring/firmware/Metro-Arduino-Spark-Wiring.cpp
    /Users/marcus/Development/Particle/Adafruit_DHT_Library/firmware/Adafruit_DHT.cpp
    /Users/marcus/Development/Particle/Adafruit_DHT_Library/firmware/Adafruit_DHT.h
    /Users/marcus/Development/Particle/Adafruit_TSL2561/firmware/Adafruit_Sensor.cpp
    /Users/marcus/Development/Particle/Adafruit_TSL2561/firmware/Adafruit_Sensor.h
    /Users/marcus/Development/Particle/Adafruit_TSL2561/firmware/Adafruit_TSL2561_U.cpp
    /Users/marcus/Development/Particle/Adafruit_TSL2561/firmware/Adafruit_TSL2561_U.h
    /Users/marcus/Development/Particle/SparkCore-LiquidCrystal-master/firmware/LiquidCrystal.cpp
    /Users/marcus/Development/Particle/SparkCore-LiquidCrystal-master/firmware/LiquidCrystal.h
    /Users/marcus/Development/Particle/Adafruit_HDC1000/firmware/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/Adafruit_HDC1000/firmware/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/RoomGuard/RG_Luxmeter_TSL2561.cpp
    /Users/marcus/Development/Particle/RoomGuard/RG_Luxmeter.cpp
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermometer_DHT11.cpp
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermometer_HDC100x.cpp
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermometer.cpp
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermostat.cpp
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_UI_LCD.cpp
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_UI_TFT.cpp
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_UI.cpp
    /Users/marcus/Development/Particle/RoomGuard/RG_Luxmeter_TSL2561.h
    /Users/marcus/Development/Particle/RoomGuard/RG_Luxmeter.h
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermometer_DHT11.h
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermometer_HDC100x.h
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermometer.h
    /Users/marcus/Development/Particle/RoomGuard/RG_Thermostat.h
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_BMP.h
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_UI_LCD.h
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_UI_TFT.h
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard_UI.h
    /Users/marcus/Development/Particle/RoomGuard/RoomGuard.ino
    /Users/marcus/Development/Particle/RoomGuard_TFT_P1/RoomGuard_Features.h
attempting to compile firmware 
Compile failed. Exiting.

Is that the official answer to solve the problem or is Particle working on a bug fix? I 'm not really interested in rebuilding my whole file system structure to sucessfully compile my project again. Please drop a note, if or when it will be fixed. Thanks! Regards, Marcus

That's the official answer about the readon for current behaviour, but all build environments (including CLI) are currently undergoing major overhauling with a big focus on a better library support.
But that might take some more time.
On the other hand there is this GitHub issue which will keep the bug on the radar.

A possible workaround for now, might be to add some sym-links in your project folder, to make the libraries appear inside your project folder.
I've not tested this with Linux/OSX, but since I got it working with Windows, I'd not see why this should not work there too.

You can get the previous behavior that doesn’t support sub-directory compilation by installing an older CLI version:

npm install -g particle-cli@1.12.0

I wasn’t aware of your use case of keeping project files in multiple directories and including them all together. I’ll keep that in mind for the next release of the CLI.

As @ScruffR mentioned, when I need to include files from multiple places like your use case I use symbolic links to link library files next to my own project files. This will become unnecessary soon when library support is released in the CLI.

1 Like

That’s a little bit frustrating. OK, I’ve added links to include everything needed but without flattening my directory structure deploying directories. Thus, I’ve had to put an ignore file in each directory to opt out the examples etc. But, how to cope with dependencies between library files? I’ve changed simply the include directives because otherwise the files can’t be found. However, I can’t use them without changes in the Web IDE, i.e. my GIT repo is messed up with ignore files and misleading includes. At the end the compiler succeeded and the linker fails.

How can I prove if the compilation is really completely done? I assume that the compilation is stopped and the linker can’t find the files? Compilation of the given library is fine?!

iMac27Retina:SL_RoomGuard_TFT_P1 marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard_Features.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_DHT_Library/Adafruit_DHT.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_DHT_Library/Adafruit_DHT.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_FT6206/Adafruit_FT6206.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_FT6206/Adafruit_FT6206.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_HDC1000/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_HDC1000/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_ILI9341/Adafruit_ILI9341.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_ILI9341/Adafruit_ILI9341.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_STMPE610/Adafruit_STMPE610.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_STMPE610/Adafruit_STMPE610.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_Sensor.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_TSL2561_U.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_Sensor.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_TSL2561_U.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/Adafruit_mfGFX.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/fonts.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/Adafruit_mfGFX.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/fonts.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Metro-Arduino-Spark-Wiring/Metro-Arduino-Spark-Wiring.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Metro-Arduino-Spark-Wiring/Metro-Arduino-Spark-Wiring.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter_TSL2561.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_DHT11.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_HDC100x.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermostat.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_BMP.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_LCD.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_TFT.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard.ino
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter_TSL2561.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_DHT11.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_HDC100x.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermostat.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_LCD.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_TFT.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/SparkCore-LiquidCrystal/LiquidCrystal.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/SparkCore-LiquidCrystal/LiquidCrystal.cpp
attempting to compile firmware 
Compile failed. Exiting.

../../../build/target/user/platform-8/libuser.a(Adafruit_STMPE610.o): In function `TS_Point::TS_Point()':
Adafruit_STMPE610/Adafruit_STMPE610.cpp:337: multiple definition of `TS_Point::TS_Point()'
../../../build/target/user/platform-8/libuser.a(Adafruit_FT6206.o):Adafruit_FT6206/Adafruit_FT6206.cpp:201: first defined here
../../../build/target/user/platform-8/libuser.a(Adafruit_STMPE610.o): In function `TS_Point::TS_Point()':
Adafruit_STMPE610/Adafruit_STMPE610.cpp:337: multiple definition of `TS_Point::TS_Point()'
../../../build/target/user/platform-8/libuser.a(Adafruit_FT6206.o):Adafruit_FT6206/Adafruit_FT6206.cpp:201: first defined here
../../../build/target/user/platform-8/libuser.a(Adafruit_STMPE610.o): In function `TS_Point::TS_Point(short, short, short)':
Adafruit_STMPE610/Adafruit_STMPE610.cpp:340: multiple definition of `TS_Point::TS_Point(short, short, short)'
../../../build/target/user/platform-8/libuser.a(Adafruit_FT6206.o):Adafruit_FT6206/Adafruit_FT6206.cpp:204: first defined here
../../../build/target/user/platform-8/libuser.a(Adafruit_STMPE610.o): In function `TS_Point::TS_Point(short, short, short)':
Adafruit_STMPE610/Adafruit_STMPE610.cpp:340: multiple definition of `TS_Point::TS_Point(short, short, short)'
../../../build/target/user/platform-8/libuser.a(Adafruit_FT6206.o):Adafruit_FT6206/Adafruit_FT6206.cpp:204: first defined here
../../../build/target/user/platform-8/libuser.a(Adafruit_STMPE610.o): In function `TS_Point::operator==(TS_Point)':
Adafruit_STMPE610/Adafruit_STMPE610.cpp:346: multiple definition of `TS_Point::operator==(TS_Point)'
../../../build/target/user/platform-8/libuser.a(Adafruit_FT6206.o):Adafruit_FT6206/Adafruit_FT6206.cpp:210: first defined here
../../../build/target/user/platform-8/libuser.a(Adafruit_STMPE610.o): In function `TS_Point::operator!=(TS_Point)':
Adafruit_STMPE610/Adafruit_STMPE610.cpp:350: multiple definition of `TS_Point::operator!=(TS_Point)'
../../../build/target/user/platform-8/libuser.a(Adafruit_FT6206.o):Adafruit_FT6206/Adafruit_FT6206.cpp:214: first defined here
collect2: error: ld returned 1 exit status
make: *** [9ae48a0c48b72980d934a790fba468c4ed4d545c837426da57ced627355c.elf] Error 1

iMac27Retina:SL_RoomGuard_TFT_P1 marcus$ 
iMac27Retina:SL_RoomGuard_TFT_P1 marcus$ cd Adafruit_FT6206
iMac27Retina:Adafruit_FT6206 marcus$ ll
total 32
-rwxr-xr-x@ 1 marcus  staff  5740 30 Apr 19:28 Adafruit_FT6206.cpp
-rwxr-xr-x@ 1 marcus  staff  2461 30 Apr 19:29 Adafruit_FT6206.h
drwxr-xr-x@ 5 marcus  staff   170  2 Jul 09:00 examples
-rw-r--r--  1 marcus  staff    16  2 Jul 09:01 particle.ignore
iMac27Retina:Adafruit_FT6206 marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/Adafruit_FT6206/firmware/Adafruit_FT6206.h
    /Users/marcus/Development/Particle/Adafruit_FT6206/firmware/Adafruit_FT6206.cpp
attempting to compile firmware 
downloading binary from: /v1/binaries/57778c28b05afcb03af3e22c
saving to: p1_firmware.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
   3420	      8	    572	   4000	    fa0	
Compile succeeded.

I’m not sure, but this seems like a flaw in the implementation of STMPE610 lib.
If you haven’t added it yourself, there is no protection against multiple inclusion.

You’d either do that via

#pragma once

or

#ifndef __ADAFRUIT_STMPE610_H__
#define __ADAFRUIT_STMPE610_H__
  ...
#endif

I’ve opened an issue there

Good idea, but:

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/
#ifndef adafruit_STMPE610_h
#define adafruit_STMPE610_h

#ifdef PLATFORM_ID  //Only defined if a Particle device
 #include "application.h"
...

And, every lib can be compiled separately.

But your right: TS_Point is an inner class and indeed it is defined twice. The both libraries are used mutually exclusively. I can leave one out because this hardware variant doesn’t use a restive touch screen! Deleting the link and “shazam” my firmware is built! Wow, thanks God and you for the hint.

It’s really high time for library support in particle_cli! :smile:

1 Like

How about wrapping the declaration of TS_Point in an #ifdef block (or breaking it out into a seperate header which features MIP)?

But you are right - it IS high on time for working library support :sunglasses:

Never halloo till you are out of the woods. The whole bunch of needed files is included and successfully compiled and the firmware is built. Bu the INO-file in the main sub directory is ignored. Have a look:

iMac27Retina:SL_RoomGuard_TFT_P1 marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard_Features.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_DHT_Library/Adafruit_DHT.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_DHT_Library/Adafruit_DHT.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_FT6206/Adafruit_FT6206.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_FT6206/Adafruit_FT6206.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_HDC1000/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_HDC1000/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_ILI9341/Adafruit_ILI9341.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_ILI9341/Adafruit_ILI9341.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_Sensor.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_TSL2561_U.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_Sensor.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_TSL2561_U.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/Adafruit_mfGFX.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/fonts.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/Adafruit_mfGFX.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/fonts.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Metro-Arduino-Spark-Wiring/Metro-Arduino-Spark-Wiring.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Metro-Arduino-Spark-Wiring/Metro-Arduino-Spark-Wiring.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter_TSL2561.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_DHT11.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_HDC100x.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermostat.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_BMP.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_LCD.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_TFT.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter_TSL2561.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_DHT11.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_HDC100x.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermostat.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_LCD.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_TFT.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard.ino
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/SparkCore-LiquidCrystal/LiquidCrystal.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/SparkCore-LiquidCrystal/LiquidCrystal.cpp
attempting to compile firmware 
downloading binary from: /v1/binaries/5778bcd14cea010b23265a5a
saving to: p1_firmware.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
  11500	      8	    912	  12420	   3084	
Compile succeeded.
Saved firmware to: /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/p1_firmware.bin

The firmware is much too small and I can edit the INO file and include errors without any changes regarding the compilation process. Tried to include a particle include without any success.

Workaround is to push the INO to the top level directory:

iMac27Retina:SL_RoomGuard_TFT_P1 marcus$ particle compile p1 . --target 0.5.1 --saveTo p1_firmware.bin

Compiling code for p1
Targeting version: 0.5.1

Including:
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard_Features.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard.ino
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_DHT_Library/Adafruit_DHT.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_DHT_Library/Adafruit_DHT.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_FT6206/Adafruit_FT6206.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_FT6206/Adafruit_FT6206.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_HDC1000/Adafruit_HDC1000.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_HDC1000/Adafruit_HDC1000.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_ILI9341/Adafruit_ILI9341.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_ILI9341/Adafruit_ILI9341.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_Sensor.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_TSL2561_U.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_Sensor.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_TSL2561/Adafruit_TSL2561_U.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/Adafruit_mfGFX.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/fonts.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/Adafruit_mfGFX.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Adafruit_mfGFX_IDE/fonts.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Metro-Arduino-Spark-Wiring/Metro-Arduino-Spark-Wiring.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/Metro-Arduino-Spark-Wiring/Metro-Arduino-Spark-Wiring.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter_TSL2561.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_DHT11.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_HDC100x.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermostat.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_BMP.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_LCD.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_TFT.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter_TSL2561.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Luxmeter.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_DHT11.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer_HDC100x.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermometer.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RG_Thermostat.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_LCD.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI_TFT.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/RoomGuard/RoomGuard_UI.cpp
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/SparkCore-LiquidCrystal/LiquidCrystal.h
    /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/SparkCore-LiquidCrystal/LiquidCrystal.cpp
attempting to compile firmware 
downloading binary from: /v1/binaries/5778d67cde7298983afdd4d4
saving to: p1_firmware.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
  36140	    184	   1436	  37760	   9380	
Compile succeeded.
Saved firmware to: /Users/marcus/Development/Particle/SL_RoomGuard_TFT_P1/p1_firmware.bin

However, I have to write a separate INO for each hardware variant now. My original idea was to write only one app (ino) for all variants and have a config files in separate directories with also separated library repos via GIT. To put 42 files into one directory and copy repo files manually after GIT updates etc. can’t be the final answer. Library support should also give a answer to open issues like subdirectories or relative paths. For now, I can proceed and have to copy or backport my fixes from the current prototype to the projects of the older one.