Home Development Tools VSCode Solve the problem that vscode cannot find the c++ header file under windows

Solve the problem that vscode cannot find the c++ header file under windows

Dec 30, 2019 am 09:37 AM
c++ vscode windows head File not found solve

Solve the problem that vscode cannot find the c++ header file under windows

The problem that vscode cannot find the header file is because the default compiler of vscode under windows is the header file path of Microsoft's MSVC (the compiler used by vscode).

If you have not installed vs, you will definitely get an error because the header file cannot be found. If you install vs, you will get the same error. The reasons are as follows:

1. You have misconfigured the vscode configuration file;

2. You used a header file that does not exist in the MSVC header file library, such as bits/stdc .h

Solution:

1. Modify the configuration File;

2. Copy the required header files to the header file path of vs

If the computer does not have vs installed and the mingw series is installed, it can only be solved by modifying the configuration file.

1. How to modify the configuration file:

Create a new c_cpp_properties.json file in the .vscode folder

Solve the problem that vscode cannot find the c++ header file under windows

Paste the following code into it. Among them, change the includePath option to the lib/gcc/x86_64-w64-mingw32/8.1.0/include folder path

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "C:/Program Files/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}
Copy after login

for non- For header files in the standard library, the path can also be appended to includePath through list appending

For example:

Solve the problem that vscode cannot find the c++ header file under windows

## 2. Modification Header file method:

First you must install one of the Microsoft vs series, such as:

visual stdio 2017 Community, and then find the header file path under the installation path

The default is:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include

Solve the problem that vscode cannot find the c++ header file under windows

Then paste the header files you need into this folder, so that MSVC and mingw have the same header file library.

Recommended related articles and tutorials:

vscode tutorial

The above is the detailed content of Solve the problem that vscode cannot find the c++ header file under windows. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

vscode start front-end project command vscode start front-end project command Apr 15, 2025 pm 10:00 PM

The command to start a front-end project in VSCode is code. The specific steps include: Open the project folder. Start VSCode. Open the project. Enter the startup command code. in the terminal panel. Press Enter to start the project.

What language is vscode used What language is vscode used Apr 15, 2025 pm 11:03 PM

Visual Studio Code (VSCode) is developed by Microsoft, built using the Electron framework, and is mainly written in JavaScript. It supports a wide range of programming languages, including JavaScript, Python, C, Java, HTML, CSS, etc., and can add support for other languages ​​through extensions.

Can vscode be used on mac Can vscode be used on mac Apr 15, 2025 pm 07:45 PM

VS Code performs well on macOS and can improve development efficiency. The installation and configuration steps include: installing VS Code and configuring. Install language-specific extensions (such as ESLint for JavaScript). Install the extensions carefully to avoid excessive startup slowing down. Learn basic features such as Git integration, terminal and debugger. Set the appropriate theme and code fonts. Note potential issues: extended compatibility, file permissions, etc.

vscode running task shortcut key vscode running task shortcut key Apr 15, 2025 pm 09:39 PM

Run tasks in VSCode: Create tasks.json file, specify version and task list; configure the label, command, args, and type of the task; save and reload the task; run the task using the shortcut key Ctrl Shift B (macOS for Cmd Shift B).

Is the vscode extension malicious? Is the vscode extension malicious? Apr 15, 2025 pm 07:57 PM

VS Code extensions pose malicious risks, such as hiding malicious code, exploiting vulnerabilities, and masturbating as legitimate extensions. Methods to identify malicious extensions include: checking publishers, reading comments, checking code, and installing with caution. Security measures also include: security awareness, good habits, regular updates and antivirus software.

vscode c header file error vscode c header file error Apr 15, 2025 pm 09:30 PM

The header file errors that occur when writing C code in Visual Studio Code are usually caused by the following reasons: 1. Path setting errors; 2. Header file spelling errors; 3. Header file version mismatch; 4. Dependency header file is missing; 5. Definition of header files is repeated. To resolve these errors, check and correct the include path, double-check the spelling error, confirm that the header version matches, include all necessary dependency header files, and make sure that the header files are not defined duplicately.

Common commands for vscode terminal Common commands for vscode terminal Apr 15, 2025 pm 10:06 PM

Common commands for VS Code terminals include: Clear the terminal screen (clear), list the current directory file (ls), change the current working directory (cd), print the current working directory path (pwd), create a new directory (mkdir), delete empty directory (rmdir), create a new file (touch) delete a file or directory (rm), copy a file or directory (cp), move or rename a file or directory (mv) display file content (cat) view file content and scroll (less) view file content only scroll down (more) display the first few lines of the file (head)

See all articles