Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to configure the project header file path for VSCode

Shulou Source: shulou.com Published: 2022-06-01 10:49:47 10月03日 Update

This article mainly explains "how to configure the project header file path in VSCode". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to configure the project header file path in VSCode.

To Coding with VSCode, the editor needs to configure the header file path by itself, that is, automatically establish a c_cpp_properties.json file to manage the header file path, and then manually add which libraries you need. The method is very simple, as follows:

1. Generate c_cpp_properties.json file

Press "F1" to start the instruction input box, enter Cmax Cleavage, and select the first item Edit Configuration:

A Json file is then automatically generated:

two。 Add header file path

We only need to add the required header file path to the IncludePath in the red box, such as my project:

As prompted here, the common installation locations for the header files of common libraries are as follows:

/ usr/include//usr/local/include

So these two basic things to add, if you don't know where the header file of the library you installed is, but you know the key header file name, you can use the locate command to find it:

Locate ros.h | grep include

This command means to find the location of all ros.h and find the path with the include field in the path:

Thank you for your reading, the above is the content of "how to configure the project header file path for VSCode". After the study of this article, I believe you have a deeper understanding of how to configure the project header file path for VSCode, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: File path project configuration learning location content command that is generation input two key name field common common idea situation meaning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS Microsoft Linux Shulou Information