Multiple folders in the DEV IDE - compile errors go to blank file

I have been putting my files into folders in the Dev IDE to aid organisation and my sanity :wink:

However since I did this any errors on compilation link to an empty .ino or .h file instead of the correct file.

For example I compile my project with an error in foo.cpp, the compiler says the correct line but says the error is in foo.ino. Clicking the error takes me to foo.ino which is an empty file.

For example I compile my project with an error in foo.h, the compiler says the correct line and the correct file foo.h. Clicking the link takes me to foo.h which is an empty file.

Is this a known issue with using folders in the Dev IDE or have I missed something?

Can you actually compile anything successfully when using folders ?
AFAIK the cloud compiler only takes the files in the root dir of your project, but that may have changed since I started using dev.

I’ve seen the same issue, but didn’t report the bug. Looking at the GitHub repo, I didn’t see a bug, so I filed a bug report here: Feel free to watch it on GitHub.

To address @mora’s question, I use subfolders in almost all my (current) projects. I don’t think I’ve run into the issue. Dev just flattens the file tree as it sends files to the cloud compiler, so #include statement’s paths should not include the subfolder. If you follow that rule, subfolders work fine.

[edit to add an example, since my language was kinda ambiguous]

For example:

Say I’ve got a subfolder called cool-lib and a cool.h file in there. In my main .cpp or .ino file, I’d do:
#include "cool.h"
#include "cool-lib/cool.h"


gotcha :blush:

thanks for the info. will test is later on…because the old spark dev didn’t support subfolders

edit: didn’t work for me. structure is:

main/test.cpp -> #include "mode.h"

got the error that the mode.h could not be found. added the folders by using “add project folder” in the Particle Dev (not web ide)

edit2: sorry my fault. subfolders must be in the same projekt, “add project folder” does not work. eg:


and afterwards just open the project folder

Hey, I’ve noticed this issue too and it is quite infuriating.

I’ve uploaded a video capture to YouTube that shows what the user experience is with this error:


note that not only are the file names wrong, the line numbers referenced in the compiler error message are wrong too (it appears they are referencing line numbers after blank lines are removed???)