"Cannot open source file 'chrono'" Error

I am currently working on a project to take in I2C data through a B404x and upload to the cloud. When I attempt to include the "Wire.h" library in my code, IntelliSense reads the error:
"cannot open source file 'chrono' (dependency of "C:....particle\toolchains\deviceOS\4.1.0\user\inc\Particle.h")"

I assume this means I may have to get a newer version of MSVC after looking up some simple solutions to this error, but I was wondering if there is a step before including Wire.h that requires me to include other libraries? I do not know what "chrono" is.

Not sure what the issue is without seeing your code. Please post your code or a sample which shows what is going on. This link I found by doing a search on "chrono":
https://community.particle.io/t/chrono-no-such-file-or-directory/56870

In general, chrono literals can be found here in the docs:
https://docs.particle.io/reference/device-os/api/chrono-literals/chrono-literals/

There is no code other than that line besides void setup() and void loop(). Actually, even without the Wire.h line I still receive the error. I will look into your references.

Does your Windows home directory contain a space or special character in it? That will cause a problem with local builds.

Does the problem also occur with Particle: Cloud compile?

I chose a directory that does not contain a space or special character, as it would not let me create a Particle project unless I chose a directory of those specifications.

Running through trying out cloud compile, it seems the program isn't accepting my login credentials even when I copy and paste it from the web. This is a whole other issue entirely that I will have to look into, so I don't have an answer to that aspect of your question.

Can confirm, cloud compile does not give me any errors. Directory still does not have any spaces or special characters

Check out the documentation here:
https://docs.particle.io/firmware/best-practices/firmware-introduction/#getting-started

There you will find a boilerplate application you can try for starters and build up from there:

#include "Particle.h"

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

SerialLogHandler logHandler;

void setup() 
{
    Particle.connect();
}

void loop() 
{
}

I'd just use the cloud compiler for now.

I realize your project directory doesn't have any spaces, but I wanted to make sure that any parent directory of it also does not contain spaces. Parent directories also cause problems, but that restriction is not imposed by the create new project option because cloud compile works with parent directories containing spaces, but local compile does not.

Hi Mitchell,

It may be worth to do a Workbench functionality check to ensure everything is installed and configured correctly. Please follow the instructions in this link, hopefully that will get local compiling up and running (and if not, shed more light into what could be happening).

Hi Manuel,

I found the issue. The include paths in the launch.json file did not have the included paths for the standard C++ libraries, thus I could not retrieve the source files, as it was saying. This was fixed by simply adding a few lines into the file with the directory path of where the source file were originally located and installed.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.