vscode识别头文件

To help VSCode recognize the location of header files in an autoconf C language project, you can modify the c_cpp_properties.json file in your project directory. This file is used to specify the include paths for the C/C++ IntelliSense engine in VSCode.

Here are the steps to modify the c_cpp_properties.json file:

  1. Open the project directory in VSCode.

  2. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette.

  3. Type “C/C++: Edit Configurations (JSON)” and select the option from the list.

  4. This will open the c_cpp_properties.json file in VSCode. Add the following lines to the file:

"configurations": [
    {
        "name": "Linux",
        "includePath": [
            "${workspaceFolder}/**",
            "/usr/include",
            "/usr/local/include"
        ],
        "defines": [],
        "compilerPath": "/usr/bin/gcc",
        "cStandard": "gnu11",
        "cppStandard": "gnu++14",
        "intelliSenseMode": "gcc-x64"
    }
],

In this example, the includePath variable specifies the include paths for the C/C++ IntelliSense engine. The ${workspaceFolder}/** entry includes all files in the project directory, and the /usr/include and /usr/local/include entries include the standard system include paths for Linux.

  1. Save the c_cpp_properties.json file.

After modifying the c_cpp_properties.json file, VSCode should be able to recognize the location of header files in your autoconf C language project. If you have any other questions, please feel free to ask me

你可能感兴趣的:(IDE,vscode,c++,ide)