Workbench compile cannot find lib files

Trying to compile with workbench.
Used the Cloud compile.
It stops complaining: No such file or directory
Tried to #include with the full path does not make a difference.
The lib are loaded and part of lib directory/src

Any clues?
Thank you for helping.
jean-marc

1 Like

Where do your libraries live exactly?
This leaves some room for interpretation :wink:

How did you import the libraries?
Have you used Particle: Install Library?

If you used the dedicated command, you should get something like

C:.
├───.vscode
├───lib
│   ├───Library1
│   │   └───src
│   └───Library2
│       └───src
│           ├───SubFolder1
│           ├───SubFolder2
└───src

hello @ScruffR,
Thank you for your help.
Sound to be OK to me:

We can see that the #include already complain “cannot open source file”
If I enter the full path it complain as well.
When I enter the full path the intellisense help me to find the lib without any problems.

Then at compile of course it says “No such file or directory”.

One thing, you should remove the examples folder from the libraries (just to be on the safe side that there are no interfering sources).

Then IntelliSense isn’t always the best indicator whether or not something will actually cause any trouble, but should rather be understood as a heads-up to look closely and double check spelling (e.g. HttpClient.h is flagged but doesn’t seem to create an error message - unless the screenshot just doesn’t show it).

And finally the reason for the compile error is that the file you include actually doesn’t exist.
You are missing the extension .h :wink: (see note about IntelliSense :arrow_up:)

1 Like

@ScruffR, thanks for your answer.
Actually yes the file HttpClient make the same error but it is not on the screenshot
Yes I made a mistake with one include and missed the .h. This was just once a typo mistake. But it is not the rule.
So when I include the file I have my Intellisense showing the possibilities and i do not type it, so it would be hard to misspell. So yes I over controlled the typing and the files are right.

  1. But my question is more basic now. Is it correct to “cloud compile”?
  2. If I try compile local it does not work at all it says “Could not find task…”
  3. Is it a way to clean the make and start from scratch a new compile?
  4. I do not understand this:

    #include “lib\SF_CCS811…”
    According to me a backslash is missing after the 2 dots and lib\

Thanks again for your assistance.
jean-marc

If you cloud compile the dependencies in project.properties take precedence over the local libraries. So if you have a local library that's not available online, you need to remove the dependency.xxx setting for that library from that file.

Also, if you cloud compile, you should get a list of the files that are uploaded to the cloud in order to compile that project.
Another way to get more info about the cloud compile might be to use particle compile photon . in a terminal window.

That seems to indicate some issue with the local toolchain.

After uninstalling/reinstalling the local compiler you can do Ctrl+ShiftP Particle: Launch Compiler Shell and run make -f $PARTICLE_MAKEFILE clean-all
(beware, that shell does not let you Backspace)

Try using forward slashes instead.

Can you zip your project and PM me a link (e.g. Dropbox)?

@ScruffR, great thank you
The clean worked, but did not resolve anything :frowning:

I do not use any forward or backward slashes on the include now.

OK will send you the link for sharing…

See you and thanks again.

1 Like

can you run the Particle: Audit Environment command and share the non-sensitive portions of the report it generates here?

also, reminder: Information: How to report bugs and provide feedback

@m_m, I have received the zip file for the project and could locate some issues with the project in combination with some of the Workbench issues I already reported (e.g. interference between local copies of libraries vs. the project.properties dependencies, problems with the library’s examples folder, …).
After cleaning these up I successfully could build the project locally and in the cloud with Workbench and cloud build via CLI.

2 Likes

ok, sounds good. acknowledging that these library gotchas are uh, less than great :wink: at the moment i'm more concerned with stuff like:

If I try compile local it does not work at all it says “Could not find task…”

and things of that nature (broadly speaking, Workbench orchestration issues)

thanks once again for the help :pray::+1:

2 Likes

Thanks to @ScruffR assistance:
Removing lib/src/examples, removing extra .ino files left in my project :roll_eyes:I was able to cloud compile and flash my Photon. :smiley:
For the local compile and other tasks not being find: I opened a new project from scratch and all seems to be present and functioning.

Thank you again for the help.
jean-marc

1 Like

Thanks for all that insight,

And fun fact, I made a local lib and VSCode's Intellisense didn't 'pick it up', although Workbench compiled alright. I closed and reopened then Intellisense 'came back' alright too.