Compiling project with directory structure

I’m trying to get the ArduinoJson Library working in a project for my photon but I’m having problems compiling with the library included. Originally when compiling the project it only included the files directly under that folder so I added a particle.include file to specify which files to include.

indoor_mod.cpp
ArduinoJson/*.cpp
ArduinoJson/*.h
ArduinoJson/*.hpp
ArduinoJson/src/*.cpp
ArduinoJson/src/*.h
ArduinoJson/src/*.hpp
ArduinoJson/src/Arduino/*.cpp
ArduinoJson/src/Arduino/*.h
ArduinoJson/src/Arduino/*.hpp
ArduinoJson/src/Internals/*.cpp
ArduinoJson/src/Internals/*.h
ArduinoJson/src/Internals/*.hpp
ArduinoJson/include/*.cpp
ArduinoJson/include/*.h
ArduinoJson/include/*.hpp
ArduinoJson/include/ArduinoJson/*.cpp
ArduinoJson/include/ArduinoJson/*.h
ArduinoJson/include/ArduinoJson/*.hpp
ArduinoJson/include/ArduinoJson/Arduino/*.cpp
ArduinoJson/include/ArduinoJson/Arduino/*.h
ArduinoJson/include/ArduinoJson/Arduino/*.hpp
ArduinoJson/include/ArduinoJson/Internals/*.cpp
ArduinoJson/include/ArduinoJson/Internals/*.h
ArduinoJson/include/ArduinoJson/Internals/*.hpp

Then it seems to upload all the necessary files but can’t include them properly. I get “file not found” errors for included hpp files even though they were pushed to the cloud server.

$ particle compile photon indoor_mod/firmware/

Compiling code for photon

Including:
    /home/ian/src/homesensorsproject/indoor_mod/firmware/indoor_mod.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/ArduinoJson.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/ArduinoJson.h
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/DynamicJsonBuffer.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonArray.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonBuffer.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonObject.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonVariant.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Arduino/Print.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/IndentedPrint.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/JsonParser.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/List.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/Prettyfier.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/QuotedString.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/StringBuilder.cpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson.h
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/DynamicJsonBuffer.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonArray.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonBuffer.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonObject.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonPair.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonVariant.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/StaticJsonBuffer.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Arduino/Print.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/DummyPrint.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/IndentedPrint.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonBufferAllocated.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonParser.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonPrintable.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonVariantContent.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonVariantType.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonWriter.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/List.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ListConstIterator.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ListIterator.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ListNode.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/Prettyfier.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/QuotedString.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ReferenceType.hpp
    /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/StringBuilder.hpp
attempting to compile firmware 
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/indoor_mod.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/ArduinoJson.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/ArduinoJson.h
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/DynamicJsonBuffer.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonArray.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonBuffer.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonObject.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/JsonVariant.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Arduino/Print.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/IndentedPrint.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/JsonParser.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/List.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/Prettyfier.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/QuotedString.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/src/Internals/StringBuilder.cpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson.h
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/DynamicJsonBuffer.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonArray.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonBuffer.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonObject.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonPair.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/JsonVariant.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/StaticJsonBuffer.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Arduino/Print.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/DummyPrint.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/IndentedPrint.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonBufferAllocated.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonParser.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonPrintable.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonVariantContent.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonVariantType.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/JsonWriter.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/List.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ListConstIterator.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ListIterator.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ListNode.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/Prettyfier.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/QuotedString.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/ReferenceType.hpp
pushing file: /home/ian/src/homesensorsproject/indoor_mod/firmware/ArduinoJson/include/ArduinoJson/Internals/StringBuilder.hpp
Errors
DynamicJsonBuffer.cpp:7:56: fatal error: ../include/ArduinoJson/DynamicJsonBuffer.hpp: No such file or directory
 #include "../include/ArduinoJson/DynamicJsonBuffer.hpp"
                                                        ^
compilation terminated.
make[1]: *** [../build/target/user/platform-6DynamicJsonBuffer.o] Error 1
make: *** [user] Error 2

Compile failed -  compile failed

Any idea what I should do to compile this properly?

Use only the name without the path. eg. #include "DynamicJsonBuffer.hpp"

It’s super dumb as how it works now is the files are pushed into a folder in the build farm flattened so the relative directory path won’t work

RIght. I figured something like that was going on but I didn’t try it out myself.