# Workbench compile cannot find lib files

**URL:** <https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559>\
**Category:** Particle Workbench\
**Tags:** photon\
**Created:** [February 5, 2019, 5:17pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559 "2019-02-05T17:17:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmjobin](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jmjobin](https://community.particle.io/u/jmjobin)\
**Post date:** [February 5, 2019, 5:17pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/1 "2019-02-05T17:17:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 5, 2019, 8:44pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/2 "2019-02-05T20:44:50Z")

</div>

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

> [@jmjobin](#):
>
> The lib are loaded and part of lib directory/src

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

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

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

```

---

<div class="post-metadata">

**Author:** ![jmjobin](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jmjobin](https://community.particle.io/u/jmjobin)\
**Post date:** [February 7, 2019, 12:48pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/3 "2019-02-07T12:48:05Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/b/a/ba87e5be0be3cac07cc7ef8a2bbe4e5730118d1f.png)

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”.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 7, 2019, 3:00pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/4 "2019-02-07T15:00:55Z")

</div>

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` 😉 (see note about IntelliSense ⬆)

---

<div class="post-metadata">

**Author:** ![jmjobin](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jmjobin](https://community.particle.io/u/jmjobin)\
**Post date:** [February 8, 2019, 9:23am UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/5 "2019-02-08T09:23:43Z")

</div>

@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:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/6/3/6344bc0d0af88978d1a74e79b3eb41ccb1ce8ccf.png)  
#include “lib\SF\_CCS811…”  
According to me a backslash is missing after the 2 dots and lib\

Thanks again for your assistance.  
jean-marc

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 8, 2019, 10:18am UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/6 "2019-02-08T10:18:35Z")

</div>

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.

> [@jmjobin](#):
>
> If I try compile local it does not work at all it says “Could not find task…”

That seems to indicate some issue with the local toolchain.

> [@jmjobin](#):
>
> Is it a way to clean the make and start from scratch a new compile?

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)_

> [@jmjobin](#):
>
> According to me a backslash is missing after the 2 dots and lib\

Try using forward slashes instead.

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

---

<div class="post-metadata">

**Author:** ![jmjobin](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jmjobin](https://community.particle.io/u/jmjobin)\
**Post date:** [February 8, 2019, 10:45am UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/7 "2019-02-08T10:45:22Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![m\_m](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/m_m/32/18365_2.png) [@m\_m](https://community.particle.io/u/m_m)\
**Post date:** [February 8, 2019, 3:56pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/8 "2019-02-08T15:56:26Z")

</div>

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](https://community.particle.io/t/information-how-to-report-bugs-and-provide-feedback/44245)

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [February 8, 2019, 4:12pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/9 "2019-02-08T16:12:25Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![m\_m](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/m_m/32/18365_2.png) [@m\_m](https://community.particle.io/u/m_m)\
**Post date:** [February 8, 2019, 4:28pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/10 "2019-02-08T16:28:02Z")

</div>

ok, sounds good. acknowledging that these library gotchas are uh, less than great 😉 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 🙏👍

---

<div class="post-metadata">

**Author:** ![jmjobin](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jmjobin](https://community.particle.io/u/jmjobin)\
**Post date:** [February 14, 2019, 1:47pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/11 "2019-02-14T13:47:21Z")

</div>

Thanks to @ScruffR assistance:  
Removing lib/src/examples, removing extra .ino files left in my project 🙄I was able to cloud compile and flash my Photon. 😃  
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

---

<div class="post-metadata">

**Author:** ![emcdee](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/emcdee/32/17701_2.png) [@emcdee](https://community.particle.io/u/emcdee)\
**Post date:** [June 24, 2023, 6:14pm UTC](https://community.particle.io/t/workbench-compile-cannot-find-lib-files/47559/12 "2023-06-24T18:14:05Z")

</div>

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.
