How to include a header file for a sensor API

Hello, I am a mentor from team 7505,a rookie team. We programming in C++,now we have a trouble is that we can’t use the 2M DISTANCE SENSOR, which can buy in http://www.revrobotics.com/rev-31-1505/.
I include it’s API to my code,and creat a includepath in.vscode\c_cpp_properties.json. But I still can’t build my code because fatal error: vl53l0x_api.h: No such file or directory.
Is anyone used this sensor ever,can you show me your code ?or anyone who can tell me how to slove it. I am very grateful for your help! Thanks!
I am a Chinese, I am sorry for my poor English,but I am happly there.:grin:

You can try specifying the whole path in your ‘include’ just to see if the problem is with include paths or something else. For example,

#include "C:\Users\Public\mylibrary\test.h"

If that works, then the problem is with your include path. If it doesn’t work, then your h file either doesn’t exist there or something was typed incorrectly.

Note: Do not use full-path includes in your code for anything other than testing. It makes your code very computer-dependent. If you move it or try to build it on another computer, it will likely not build.

Yeah, Thank you very much. I solved this problem by referring to this article in https://github.com/wpilibsuite/vscode-wpilib/issues/126. I need to add a path in build.gradle.:grin:

1 Like