Обнаружены ошибки include измените includepath

I am using Visual Studio Code in my C++ project. I installed Microsoft C/C++ Extension for VS Code. I got the following error:

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/path/to/project/file.cpp) will be provided by the Tag Parser.

asked Aug 9, 2017 at 6:50

banan3'14's user avatar

3

Close and re-open Visual Studio Code.

Sabito stands with Ukraine's user avatar

answered Oct 13, 2018 at 19:38

Ivy Growing's user avatar

Ivy GrowingIvy Growing

2,7282 gold badges17 silver badges23 bronze badges

4

The answer is here: How to use C/Cpp extension and add includepath to configurations.

Click the light bulb and then edit the JSON file which is opened. Choose the right block corresponding to your platform (there are Mac, Linux, Win32 – ms-vscode.cpptools version: 3). Update paths in includePath (matters if you compile with VS Code) or browse.paths (matters if you navigate with VS Code) or both.

Thanks to @Francesco Borzì, I will append his answer here:

You have to Left 🖰 click on the bulb next to the squiggled code line.

If a #include file or one of its dependencies cannot be found, you can also click on the red squiggles under the include statements to view suggestions for how to update your configuration.

enter image description here

answered Aug 9, 2017 at 6:51

banan3'14's user avatar

banan3’14banan3’14

3,8943 gold badges24 silver badges49 bronze badges

8

If you are working with cmake-tools and the error messages says something is wrong with the configurationProvider, then you have 2 options:

  1. Use ms-vscode.cpptools instead of ms-vscode.cmake-tools
  2. Define the headers in CMakeLists.txt

Option 1: Use ms-vscode.cpptools instead of ms-vscode.cmake-tools.

  1. Open c_cpp_properties.json. (windows key on windows or cmd key on mac + shift + p, enter «c/c++ edit configurations» and chose ‘json’.
  2. Enter ms-vscode.cpptools as value for configurationProvider instead of ms-vscode.cmake-tools or whatever you have.

How it should look like after the replacement of configurationProvider:

enter image description here

One other important configuration is the include path. The assumption is that you have this configuration right. May be like following

enter image description here

Option 2: Define the headers in CMakeLists.txt

When configurationProvider is set to ms-vscode.cmake-tools in c_cpp_properties.json, VS Code uses the include information defined in the CMakeLists.txt instead of reading the includePath configs in VS Code.

So you need to setup the include path correctly:

  1. using the include_directories command (rather than the target_include_directories command) to define the headers
  2. Configure the project to reflect the change happened in the previous step.

mckelvin's user avatar

mckelvin

3,9282 gold badges29 silver badges22 bronze badges

answered Jun 26, 2021 at 6:07

Alessandro Giusa's user avatar

5

  • Left mouse click on the bulb of error line
  • Click Edit Include path
  • Then this window popup

enter image description here

  • Just set Compiler path

answered May 31, 2020 at 6:51

akash's user avatar

akashakash

7275 silver badges13 bronze badges

3

I ended up here after struggling for a while, but actually what I was missing was just:

If a #include file or one of its dependencies cannot be found, you can also click on the red squiggles under the include statements to view suggestions for how to update your configuration.

enter image description here

source: https://code.visualstudio.com/docs/languages/cpp#_intellisense

answered Jan 8, 2019 at 22:14

Francesco Borzi's user avatar

Francesco BorziFrancesco Borzi

56.3k47 gold badges179 silver badges253 bronze badges

2

I’m on a Macbook M1 Pro, and I had red squiggly error lines all over my C++ files. To solve, I did this:

  1. Open Preferences -> Settings
  2. Search for intelliSenseEngine
  3. Change «C_Cpp: Intelli Sense Engine» from Default to Tag Parser

alternatively, you could create a .vscode folder in your project root, and then create a settings.json with the content of

{
    "C_Cpp.intelliSenseEngine" : "Tag Parser"
}

ideally, you should have a c_cpp_properties.json file in the same folder with the right settings as well.

Note: I got this idea from Github here.

Foad S. Farimani's user avatar

answered Oct 2, 2022 at 8:37

Blundering Philosopher's user avatar

1

The error message «Please update your includePath» does not necessarily mean there is actually a problem with the includePath. The problem may be that VSCode is using the wrong compiler or wrong IntelliSense mode. I have written instructions in this answer on how to troubleshoot and align your VSCode C++ configuration with your compiler and project.

answered Aug 31, 2019 at 23:18

Scott McPeak's user avatar

Scott McPeakScott McPeak

9,0032 gold badges40 silver badges79 bronze badges

0

I was trying a hello world program, and this line:

#include <stdio.h>

was underlined green. I tried:

  1. Deleting the line
  2. Re-writing the line
  3. Clicking the yellow bulb and choosing to update

fixed the error warning. i don’t know if it fixed the actual problem. But then i’m compiling via a linux VM on Windows 10

answered Sep 20, 2017 at 12:14

Zach Smith's user avatar

Zach SmithZach Smith

8,48813 gold badges60 silver badges134 bronze badges

0

Go to your c_cpp_properties.json file by searching from settings.There you might see the following code

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

Change the compiler path as below

"compilerPath": "/usr/bin/g++",

answered Mar 7, 2021 at 19:10

Sihat Afnan's user avatar

Sihat AfnanSihat Afnan

7727 silver badges14 bronze badges

1

An alternative answer would be opening VS Code in remote WSL, if you going to compile files with g++. Just close your VS Code and open WSL and type code . After that the File Explorer shows that VS Code is now running in the context of WSL with the title bar [WSL: Ubuntu]. But make sure you’d installed the GNU compiler tools and the GDB debugger on WSL.

source: https://code.visualstudio.com/docs/cpp/config-wsl

answered Jul 4, 2021 at 8:53

Thor1n's user avatar

After closing and reopening VS, this should resolve.

answered Aug 9, 2019 at 20:59

Patrick's user avatar

PatrickPatrick

1191 silver badge3 bronze badges

  • For Windows:

1.Install Mingw-w64

2.Then Edit environment variables for your account «C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin»

3.Reload

  • For MAC

    1.Open search ,command + shift +P, and run this code “c/c++ edit configurations (ui)”

    2.open file c_cpp_properties.json and update the includePath from «${workspaceFolder}/**» to «${workspaceFolder}/inc»

answered Mar 18, 2020 at 14:31

remonsam's user avatar

If someone have this problem, maybe you just have to install build-essential.

apt install build-essential

answered May 21, 2020 at 0:27

Picki's user avatar

PickiPicki

4694 silver badges11 bronze badges

For me, using Ubuntu, I just had to install gcc to solve this issue.

sudo apt install gcc

Then, set the compiler path to gcc. Go to your c_cpp_properties.json file, set:

"compilerPath": "/usr/bin/gcc"

answered Mar 8, 2021 at 20:17

Emmanuel Murairi's user avatar

after you install the c/c++ extension, two files are created inside .vscode folder.

open c_cpp_properties.json file and paste this key-value pair inside configuration object.(if it doesn’t already exists)

"configurationProvider": "ms-vscode-cpptools"

if it does already exists in the object, see if the value part is ms-vscode-cmaketools. if such it is, replace that existing line with above line.

this will allow you to execute your cpp files along with c files.

answered Nov 2, 2022 at 13:42

navinrangar's user avatar

navinrangarnavinrangar

92410 silver badges21 bronze badges

I solved the error on my Mac by just clicking on the Edit «include path settings» and changing the compiler path to /usr/bin/clang.

banan3'14's user avatar

banan3’14

3,8943 gold badges24 silver badges49 bronze badges

answered Dec 2, 2022 at 17:29

Ajay S Patil's user avatar

In my case I did not need to close the whole VS-Code, closing the opened file (and sometimes even saving it) solved the issue.

answered Oct 21, 2020 at 8:17

Mohammed Noureldin's user avatar

My header file was in include/head.h, code in src/code.cpp. I wrote

#include "head.h"

and got this error. Changing it to

#include "../include/head.h"

fixed it.

answered Mar 16, 2022 at 22:06

Alex Li's user avatar

Alex LiAlex Li

2454 silver badges11 bronze badges

2

I solved this problem, once I removed configurationProvider node and set
cStandard and cppStandard to default values:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}",
                "${workspaceFolder}/**",
                "${workspaceFolder}/test",
                "/opt/qt5/include/QtCore",
                "${workspaceFolder}/test"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "${default}",
            "cppStandard": "${default}",
            "intelliSenseMode": "linux-clang-x64"
        }
    ],
    "version": 4
}

answered Aug 23, 2022 at 11:06

Olga Pshenichnikova's user avatar

For Windows:

  1. Please add this directory to your environment variable(Path):

C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\

  1. For Include errors detected, mention the path of your include folder into

«includePath»: [
«C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/include/» ]

, as this is the path from where the compiler fetches the library to be included in your program.

Sohail Aslam's user avatar

answered Apr 4, 2020 at 8:30

Hridaya Nagaria's user avatar

In case you’ve copied and pasted code into your new file in VS Code

Please delete #include <iostream> and try to build again.

banan3'14's user avatar

banan3’14

3,8943 gold badges24 silver badges49 bronze badges

answered Dec 10, 2021 at 15:35

Praven Duncker's user avatar

1

I am using Visual Studio Code in my C++ project. I installed Microsoft C/C++ Extension for VS Code. I got the following error:

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/path/to/project/file.cpp) will be provided by the Tag Parser.

asked Aug 9, 2017 at 6:50

banan3'14's user avatar

3

Close and re-open Visual Studio Code.

Sabito stands with Ukraine's user avatar

answered Oct 13, 2018 at 19:38

Ivy Growing's user avatar

Ivy GrowingIvy Growing

2,7282 gold badges17 silver badges23 bronze badges

4

The answer is here: How to use C/Cpp extension and add includepath to configurations.

Click the light bulb and then edit the JSON file which is opened. Choose the right block corresponding to your platform (there are Mac, Linux, Win32 – ms-vscode.cpptools version: 3). Update paths in includePath (matters if you compile with VS Code) or browse.paths (matters if you navigate with VS Code) or both.

Thanks to @Francesco Borzì, I will append his answer here:

You have to Left 🖰 click on the bulb next to the squiggled code line.

If a #include file or one of its dependencies cannot be found, you can also click on the red squiggles under the include statements to view suggestions for how to update your configuration.

enter image description here

answered Aug 9, 2017 at 6:51

banan3'14's user avatar

banan3’14banan3’14

3,8943 gold badges24 silver badges49 bronze badges

8

If you are working with cmake-tools and the error messages says something is wrong with the configurationProvider, then you have 2 options:

  1. Use ms-vscode.cpptools instead of ms-vscode.cmake-tools
  2. Define the headers in CMakeLists.txt

Option 1: Use ms-vscode.cpptools instead of ms-vscode.cmake-tools.

  1. Open c_cpp_properties.json. (windows key on windows or cmd key on mac + shift + p, enter «c/c++ edit configurations» and chose ‘json’.
  2. Enter ms-vscode.cpptools as value for configurationProvider instead of ms-vscode.cmake-tools or whatever you have.

How it should look like after the replacement of configurationProvider:

enter image description here

One other important configuration is the include path. The assumption is that you have this configuration right. May be like following

enter image description here

Option 2: Define the headers in CMakeLists.txt

When configurationProvider is set to ms-vscode.cmake-tools in c_cpp_properties.json, VS Code uses the include information defined in the CMakeLists.txt instead of reading the includePath configs in VS Code.

So you need to setup the include path correctly:

  1. using the include_directories command (rather than the target_include_directories command) to define the headers
  2. Configure the project to reflect the change happened in the previous step.

mckelvin's user avatar

mckelvin

3,9282 gold badges29 silver badges22 bronze badges

answered Jun 26, 2021 at 6:07

Alessandro Giusa's user avatar

5

  • Left mouse click on the bulb of error line
  • Click Edit Include path
  • Then this window popup

enter image description here

  • Just set Compiler path

answered May 31, 2020 at 6:51

akash's user avatar

akashakash

7275 silver badges13 bronze badges

3

I ended up here after struggling for a while, but actually what I was missing was just:

If a #include file or one of its dependencies cannot be found, you can also click on the red squiggles under the include statements to view suggestions for how to update your configuration.

enter image description here

source: https://code.visualstudio.com/docs/languages/cpp#_intellisense

answered Jan 8, 2019 at 22:14

Francesco Borzi's user avatar

Francesco BorziFrancesco Borzi

56.3k47 gold badges179 silver badges253 bronze badges

2

I’m on a Macbook M1 Pro, and I had red squiggly error lines all over my C++ files. To solve, I did this:

  1. Open Preferences -> Settings
  2. Search for intelliSenseEngine
  3. Change «C_Cpp: Intelli Sense Engine» from Default to Tag Parser

alternatively, you could create a .vscode folder in your project root, and then create a settings.json with the content of

{
    "C_Cpp.intelliSenseEngine" : "Tag Parser"
}

ideally, you should have a c_cpp_properties.json file in the same folder with the right settings as well.

Note: I got this idea from Github here.

Foad S. Farimani's user avatar

answered Oct 2, 2022 at 8:37

Blundering Philosopher's user avatar

1

The error message «Please update your includePath» does not necessarily mean there is actually a problem with the includePath. The problem may be that VSCode is using the wrong compiler or wrong IntelliSense mode. I have written instructions in this answer on how to troubleshoot and align your VSCode C++ configuration with your compiler and project.

answered Aug 31, 2019 at 23:18

Scott McPeak's user avatar

Scott McPeakScott McPeak

9,0032 gold badges40 silver badges79 bronze badges

0

I was trying a hello world program, and this line:

#include <stdio.h>

was underlined green. I tried:

  1. Deleting the line
  2. Re-writing the line
  3. Clicking the yellow bulb and choosing to update

fixed the error warning. i don’t know if it fixed the actual problem. But then i’m compiling via a linux VM on Windows 10

answered Sep 20, 2017 at 12:14

Zach Smith's user avatar

Zach SmithZach Smith

8,48813 gold badges60 silver badges134 bronze badges

0

Go to your c_cpp_properties.json file by searching from settings.There you might see the following code

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

Change the compiler path as below

"compilerPath": "/usr/bin/g++",

answered Mar 7, 2021 at 19:10

Sihat Afnan's user avatar

Sihat AfnanSihat Afnan

7727 silver badges14 bronze badges

1

An alternative answer would be opening VS Code in remote WSL, if you going to compile files with g++. Just close your VS Code and open WSL and type code . After that the File Explorer shows that VS Code is now running in the context of WSL with the title bar [WSL: Ubuntu]. But make sure you’d installed the GNU compiler tools and the GDB debugger on WSL.

source: https://code.visualstudio.com/docs/cpp/config-wsl

answered Jul 4, 2021 at 8:53

Thor1n's user avatar

After closing and reopening VS, this should resolve.

answered Aug 9, 2019 at 20:59

Patrick's user avatar

PatrickPatrick

1191 silver badge3 bronze badges

  • For Windows:

1.Install Mingw-w64

2.Then Edit environment variables for your account «C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin»

3.Reload

  • For MAC

    1.Open search ,command + shift +P, and run this code “c/c++ edit configurations (ui)”

    2.open file c_cpp_properties.json and update the includePath from «${workspaceFolder}/**» to «${workspaceFolder}/inc»

answered Mar 18, 2020 at 14:31

remonsam's user avatar

If someone have this problem, maybe you just have to install build-essential.

apt install build-essential

answered May 21, 2020 at 0:27

Picki's user avatar

PickiPicki

4694 silver badges11 bronze badges

For me, using Ubuntu, I just had to install gcc to solve this issue.

sudo apt install gcc

Then, set the compiler path to gcc. Go to your c_cpp_properties.json file, set:

"compilerPath": "/usr/bin/gcc"

answered Mar 8, 2021 at 20:17

Emmanuel Murairi's user avatar

after you install the c/c++ extension, two files are created inside .vscode folder.

open c_cpp_properties.json file and paste this key-value pair inside configuration object.(if it doesn’t already exists)

"configurationProvider": "ms-vscode-cpptools"

if it does already exists in the object, see if the value part is ms-vscode-cmaketools. if such it is, replace that existing line with above line.

this will allow you to execute your cpp files along with c files.

answered Nov 2, 2022 at 13:42

navinrangar's user avatar

navinrangarnavinrangar

92410 silver badges21 bronze badges

I solved the error on my Mac by just clicking on the Edit «include path settings» and changing the compiler path to /usr/bin/clang.

banan3'14's user avatar

banan3’14

3,8943 gold badges24 silver badges49 bronze badges

answered Dec 2, 2022 at 17:29

Ajay S Patil's user avatar

In my case I did not need to close the whole VS-Code, closing the opened file (and sometimes even saving it) solved the issue.

answered Oct 21, 2020 at 8:17

Mohammed Noureldin's user avatar

My header file was in include/head.h, code in src/code.cpp. I wrote

#include "head.h"

and got this error. Changing it to

#include "../include/head.h"

fixed it.

answered Mar 16, 2022 at 22:06

Alex Li's user avatar

Alex LiAlex Li

2454 silver badges11 bronze badges

2

I solved this problem, once I removed configurationProvider node and set
cStandard and cppStandard to default values:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}",
                "${workspaceFolder}/**",
                "${workspaceFolder}/test",
                "/opt/qt5/include/QtCore",
                "${workspaceFolder}/test"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "${default}",
            "cppStandard": "${default}",
            "intelliSenseMode": "linux-clang-x64"
        }
    ],
    "version": 4
}

answered Aug 23, 2022 at 11:06

Olga Pshenichnikova's user avatar

For Windows:

  1. Please add this directory to your environment variable(Path):

C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin\

  1. For Include errors detected, mention the path of your include folder into

«includePath»: [
«C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/include/» ]

, as this is the path from where the compiler fetches the library to be included in your program.

Sohail Aslam's user avatar

answered Apr 4, 2020 at 8:30

Hridaya Nagaria's user avatar

In case you’ve copied and pasted code into your new file in VS Code

Please delete #include <iostream> and try to build again.

banan3'14's user avatar

banan3’14

3,8943 gold badges24 silver badges49 bronze badges

answered Dec 10, 2021 at 15:35

Praven Duncker's user avatar

1

If you got this problem, Relax, u r probablu 1000th one here ;)
I have added screenshots, these are not links to some terrifying third party documentations (;

Solution

1.installation of c++ :
check you have the c++ installed, (it dosent come pre-installed! You have to do it)
If not install it. If you have installed it, navigate to it, and get the path
click on the path at top in file explorer, and Ctrl+C to copy it here is how u get the path

2.path environment variable setup
steps:
i.left click This pc(in file explorer)here

ii. manage this menu will open

iii. scroll down in the about section, find «Advanced System Settings» and follow along this

V. «edit environment variable» dialogue box will open, click new, then paste the link to the gcc compiler that you installed firstly.

Now, this path is set as environment variable, try running command : gcc —version in command panel, if still there is error, try uploading different paths of gcc.exe to the environment variable «Path». Also, re-starting pc is recommended if path variable change doesn’t appear.

Now we start(or restart if it was open) the Vs-code(just a little to go)
i. Shift+Ctrl+p then : follow this

ii.then this
if the dropdown dosnt show any option, try re-starting vs-code, or pc, re-setting the environment variable step, or re-installing c++ and starting over(in worst case)
iii.scroll down the same page, and paste the path to include folders from c++ to text box corrosponding to «Include path» . you have to first get this path, search for folder with name «include», copy and add its path.(many times, ide is capable to automate this step;))

Now try running the code, it must be good to go, but iff it still throws error, try repeating process of adding environment variable, re-staqrting vscode, or even then, re-installing c++.

P1XELCORE

0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

1

10.08.2020, 16:18. Показов 91363. Ответов 26

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

Всем привет, хотел начать писать на плюсах в vs code, установил, всё гуд, mingw поставил, настроил всё, когда начинаю компилировать прогу выдает ошибки «Обнаружены ошибки #include. Измените includePath», что он хочет от меня?? (os win10)

Это файл c_cpp_properties.json

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\MinGW\\lib\\gcc\\mingw32\\9.2.0\\include\\c++"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\MinGW\\bin\\gcc.exe",
            "cStandard": "c11",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "gcc-x86",
            "browse": {
                "path": []
            }
        }
    ],
    "version": 4
}

launch.json

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  "version": "0.2.0",
    "configurations": [
        {
            "name": "g++.exe - Сборка и отладка активного файла",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Включить автоматическое форматирование для gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: g++.exe build active file"
        }
    ]
}

tasks.json

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "C/C++: g++.exe build active file",
            "command": "C:\\MinGW\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "C:\\MinGW\\bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

10.08.2020, 16:18

26

437 / 315 / 126

Регистрация: 18.07.2017

Сообщений: 1,421

11.08.2020, 13:06

2

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

Обнаружены ошибки #include. Измените includePath», что он хочет от меня?

Тебя на шелле, чтоли читать учили, раз ты не видишь то, что после хеш-тега?
Проверь пути до директорий с исходниками и либами.

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

«includePath»: [
«${workspaceFolder}/**»,
«C:\\MinGW\\lib\\gcc\\mingw32\\9.2.0\\include\\c++»
],

Проверь наличие таких директорий, либо поправь пути если они в другом месте.



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

11.08.2020, 13:15

 [ТС]

3

Цитата
Сообщение от assemberist
Посмотреть сообщение

Проверь наличие таких директорий, либо поправь пути если они в другом месте.

я сам прописал этот путь, было бы странно если бы там не было этих директорий)
изначально там не было пути, поэтому я решил что стоит в includPath ещё и путь прописать поэтому так и сделал, но это не решило моей проблемы



0



фрилансер

4909 / 4550 / 960

Регистрация: 11.10.2019

Сообщений: 11,912

11.08.2020, 13:50

4

P1XELCORE, ${workspaceFolder}/**

звёзды вроде не к месту ?

редактируй эти настройки через визард, тогда будет меньше ошибок



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

11.08.2020, 14:12

 [ТС]

5

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

звёзды вроде не к месту ?

Они по дефолту стояли в этом файле. Как я понял не просто так, т.к. про них написано в справочнике «Если путь заканчивается на /**, подсистема IntelliSense будет выполнять рекурсивный поиск файлов заголовков, начиная с этого каталога.»

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

редактируй эти настройки через визард, тогда будет меньше ошибок

не совсем понимаю что значит редактировать через визард)



0



фрилансер

4909 / 4550 / 960

Регистрация: 11.10.2019

Сообщений: 11,912

11.08.2020, 14:19

6

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

через визард

то есть, напрямую файл править не надо, надо открывать свойства проекта — зависимости, пути и т.д. Там же можно посмотреть, во что раскрываются макросы вида ${…}

Добавлено через 1 минуту

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

«Обнаружены ошибки #include. Измените includePath»,

а покажи скрин, кстати



1



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

11.08.2020, 14:58

 [ТС]

7

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

а покажи скрин, кстати

Ошибка include, измените includePath в VS code



0



фрилансер

4909 / 4550 / 960

Регистрация: 11.10.2019

Сообщений: 11,912

11.08.2020, 15:07

8

P1XELCORE, iostream

и настройки тут ни при чём



1



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

11.08.2020, 15:08

 [ТС]

9

в самом коде подчеркивает проблему именно подключение библиотеки, если выбрать «Изменить параметр includePath», то кидает на вкладку изменения конфигурации IntelliSense, там по логике прописываются пути для компилятора и библиотек

Ошибка include, измените includePath в VS code



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

11.08.2020, 15:09

 [ТС]

10

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

P1XELCORE, iostream
и настройки тут ни при чём

действительно, спасибо огромное) запустилось!

только теперь ругается консоль отладки, но всё же спасибо)



0



фрилансер

4909 / 4550 / 960

Регистрация: 11.10.2019

Сообщений: 11,912

11.08.2020, 19:31

11

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

теперь ругается консоль отладки

как ругается ?



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

12.08.2020, 08:46

 [ТС]

12

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

как ругается ?

Ошибка include, измените includePath в VS code

вот эти строки о том что какие-то символы загружены, они так и должны быть? мне кажется в окно вывода должно просто хеллоу ворд выходить)
а если например написать программу где нужно вводить входные данные, то она отладку не проходит вовсе



0



фрилансер

4909 / 4550 / 960

Регистрация: 11.10.2019

Сообщений: 11,912

12.08.2020, 09:05

13

P1XELCORE, так и смотри в окне вывода. У тебя всё там не на английском, но предполагаю, это вкладка «выходные данные»

а может и «терминал». Или вообще окно в настройках не включено

Добавлено через 3 минуты
так вон, вроде, текст то вывелся синеньким. Только всякий мусор вокруг. Да и код выхода 0 вижу



0



437 / 315 / 126

Регистрация: 18.07.2017

Сообщений: 1,421

12.08.2020, 09:41

14

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

какие-то символы загружены

Судя по всему это загрузка метаданных для дебаггера из модулей, которые будут использоваться твоей программой.

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

мне кажется в окно вывода должно просто хеллоу ворд выходить

А мне кажеся, что дебаггеру плевать на ввод-вывод, если не поставлена точка останова. Если у этой консоли та же логика что и в gdb, то туда нужно вводить название переменных либо выражения. И дебаггер покажет значение переменной, либо рассчитает выражение.

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

программу где нужно вводить входные данные, то она отладку не проходит вовсе

Всмысле не проходит? Зависает? Ну так может нужно данные вводить не в консоль отладки, а в окно самой программы? У тебя там консолька не всплывает случаем на фоне?



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

12.08.2020, 10:21

 [ТС]

15

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

но предполагаю, это вкладка «выходные данные»
а может и «терминал». Или вообще окно в настройках не включено

Во вкладке «выходные данные» пусто всегда, а в терминале вот такое выходит когда без проблем компилируется

Миниатюры

Ошибка include, измените includePath в VS code
 

Ошибка include, измените includePath в VS code
 



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

12.08.2020, 10:25

 [ТС]

16

Цитата
Сообщение от assemberist
Посмотреть сообщение

Всмысле не проходит? Зависает? Ну так может нужно данные вводить не в консоль отладки, а в окно самой программы? У тебя там консолька не всплывает случаем на фоне?

Консолька не всплывает для ввода данных, просто опять что-то пишет в консоль отладки и в терминал

Миниатюры

Ошибка include, измените includePath в VS code
 

Ошибка include, измените includePath в VS code
 



0



Алексей1153

фрилансер

4909 / 4550 / 960

Регистрация: 11.10.2019

Сообщений: 11,912

12.08.2020, 10:46

17

P1XELCORE, кстати, да, у тебя приложение то консольное? Тогда консоль должна быть на экране. А в окно отладки, которое снизу, вывод в студии производится через TRACE/TRACE0/OutputDebugString (понадобится заголовок <Windows.h> )

Добавлено через 2 минуты
ещё, говорят, так можно показать/скрыть (тоже тот же заголовок нужен)

C++
1
2
ShowWindow (GetConsoleWindow(), SW_SHOW);
ShowWindow (GetConsoleWindow(), SW_HIDE);



0



437 / 315 / 126

Регистрация: 18.07.2017

Сообщений: 1,421

12.08.2020, 10:53

18

Цитата
Сообщение от P1XELCORE
Посмотреть сообщение

просто опять что-то пишет в консоль отладки и в терминал

Ну ок, а почему точку останова до сих пор не поставил? Как у тебя дебаггер будет стопать программу?



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

12.08.2020, 11:06

 [ТС]

19

Цитата
Сообщение от assemberist
Посмотреть сообщение

Ну ок, а почему точку останова до сих пор не поставил? Как у тебя дебаггер будет стопать программу?

Поставил) всё так же)

Миниатюры

Ошибка include, измените includePath в VS code
 



0



0 / 0 / 0

Регистрация: 11.04.2013

Сообщений: 78

12.08.2020, 11:09

 [ТС]

20

Цитата
Сообщение от Алексей1153
Посмотреть сообщение

кстати, да, у тебя приложение то консольное?

ну, если консолька не выходит при запуске программы, значит не консольное?)
я попробовал добавил в код то что вы написали, всё так же)



0



@michelleangela
Log diagnostics without error (file not open):
——— Diagnostics — 10.12.2019, 21:23:48
Version: 0.26.2
Current Configuration:
{
«name»: «Win32»,
«includePath»: [
«c:/OneDrive/Projekte/PlatformIO/Projects/Display XPT2046/include»,
«c:/OneDrive/Projekte/PlatformIO/Projects/Display XPT2046/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SPI/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/cores/arduino»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs»,
«C:/Users/wapjoe/.platformio/lib/Adafruit FRAM I2C_ID658»,
«C:/Users/wapjoe/.platformio/lib/DHTlib_ID1336»,
«C:/Users/wapjoe/.platformio/lib/RunningMedian_ID1361»,
«C:/Users/wapjoe/.platformio/lib/SFFS_ID2037»,
«C:/Users/wapjoe/.platformio/lib/Ticker_ID1586»,
«C:/Users/wapjoe/.platformio/lib/Time_ID44»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/HID/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/Wire/src»,
«C:/Users/wapjoe/.platformio/packages/tool-unity»
],
«browse»: {
«limitSymbolsToIncludedHeaders»: true,
«path»: [
«c:/OneDrive/Projekte/PlatformIO/Projects/Display XPT2046/include»,
«c:/OneDrive/Projekte/PlatformIO/Projects/Display XPT2046/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SPI/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/cores/arduino»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs»,
«C:/Users/wapjoe/.platformio/lib/Adafruit FRAM I2C_ID658»,
«C:/Users/wapjoe/.platformio/lib/DHTlib_ID1336»,
«C:/Users/wapjoe/.platformio/lib/RunningMedian_ID1361»,
«C:/Users/wapjoe/.platformio/lib/SFFS_ID2037»,
«C:/Users/wapjoe/.platformio/lib/Ticker_ID1586»,
«C:/Users/wapjoe/.platformio/lib/Time_ID44»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/HID/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/Wire/src»,
«C:/Users/wapjoe/.platformio/packages/tool-unity»
]
},
«defines»: [
«PLATFORMIO=40100»,
«ARDUINO_AVR_NANO»,
«F_CPU=16000000L»,
«ARDUINO_ARCH_AVR»,
«ARDUINO=10808»,
«AVR_ATmega328P«
],
«intelliSenseMode»: «clang-x64»,
«cStandard»: «c11»,
«cppStandard»: «c++11»,
«compilerPath»: «C:/Users/wapjoe/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe»,
«compilerArgs»: [
«-mmcu=atmega328p»
]
}
No active translation units.

Log diagnosis with error (file opened):
——— Diagnostics — 10.12.2019, 21:25:23
Version: 0.26.2
Current Configuration:
{
«name»: «Win32»,
«includePath»: [
«c:/OneDrive/Projekte/PlatformIO/Projects/Ergometer ProMini 1.0/include»,
«c:/OneDrive/Projekte/PlatformIO/Projects/Ergometer ProMini 1.0/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/Wire/src»,
«C:/Users/wapjoe/.platformio/lib/Ticker_ID1586»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src»,
«C:/Users/wapjoe/.platformio/lib/RunningMedian_ID1361»,
«C:/Users/wapjoe/.platformio/lib/DHTlib_ID1336»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/cores/arduino»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs»,
«C:/Users/wapjoe/.platformio/lib/Adafruit FRAM I2C_ID658»,
«C:/Users/wapjoe/.platformio/lib/SFFS_ID2037»,
«C:/Users/wapjoe/.platformio/lib/Time_ID44»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/HID/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SPI/src»,
«C:/Users/wapjoe/.platformio/packages/tool-unity»
],
«browse»: {
«limitSymbolsToIncludedHeaders»: true,
«path»: [
«c:/OneDrive/Projekte/PlatformIO/Projects/Ergometer ProMini 1.0/include»,
«c:/OneDrive/Projekte/PlatformIO/Projects/Ergometer ProMini 1.0/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/Wire/src»,
«C:/Users/wapjoe/.platformio/lib/Ticker_ID1586»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src»,
«C:/Users/wapjoe/.platformio/lib/RunningMedian_ID1361»,
«C:/Users/wapjoe/.platformio/lib/DHTlib_ID1336»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/cores/arduino»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/variants/eightanaloginputs»,
«C:/Users/wapjoe/.platformio/lib/Adafruit FRAM I2C_ID658»,
«C:/Users/wapjoe/.platformio/lib/SFFS_ID2037»,
«C:/Users/wapjoe/.platformio/lib/Time_ID44»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/HID/src»,
«C:/Users/wapjoe/.platformio/packages/framework-arduino-avr/libraries/SPI/src»,
«C:/Users/wapjoe/.platformio/packages/tool-unity»
]
},
«defines»: [
«PLATFORMIO=40100»,
«ARDUINO_AVR_PRO»,
«F_CPU=16000000L»,
«ARDUINO_ARCH_AVR»,
«ARDUINO=10808»,
«AVR_ATmega328P«
],
«intelliSenseMode»: «clang-x64»,
«cStandard»: «c11»,
«cppStandard»: «c++11»,
«compilerPath»: «C:/Users/wapjoe/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe»,
«compilerArgs»: [
«-mmcu=atmega328p»
]
}
Translation Unit Mappings:
[ C:\OneDrive\Projekte\PlatformIO\Projects\Ergometer ProMini 1.0\src\main.cpp ]:
C:\ONEDRIVE\PROJEKTE\PLATFORMIO\PROJECTS\ERGOMETER PROMINI 1.0\SRC\MAIN.CPP
Translation Unit Configurations:
[ C:\OneDrive\Projekte\PlatformIO\Projects\Ergometer ProMini 1.0\src\main.cpp ]:
Process ID: 19720
Memory Usage: 19 MB
Compiler Path: C:/Users/wapjoe/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe
Includes:
C:\ONEDRIVE\PROJEKTE\PLATFORMIO\PROJECTS\ERGOMETER PROMINI 1.0\INCLUDE
C:\ONEDRIVE\PROJEKTE\PLATFORMIO\PROJECTS\ERGOMETER PROMINI 1.0\SRC
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\LIBRARIES\WIRE\SRC
C:\USERS\WAPJOE.PLATFORMIO\LIB\TICKER_ID1586
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\LIBRARIES\SOFTWARESERIAL\SRC
C:\USERS\WAPJOE.PLATFORMIO\LIB\RUNNINGMEDIAN_ID1361
C:\USERS\WAPJOE.PLATFORMIO\LIB\DHTLIB_ID1336
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\CORES\ARDUINO
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\VARIANTS\EIGHTANALOGINPUTS
C:\USERS\WAPJOE.PLATFORMIO\LIB\ADAFRUIT FRAM I2C_ID658
C:\USERS\WAPJOE.PLATFORMIO\LIB\SFFS_ID2037
C:\USERS\WAPJOE.PLATFORMIO\LIB\TIME_ID44
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\LIBRARIES\EEPROM\SRC
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\LIBRARIES\HID\SRC
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\FRAMEWORK-ARDUINO-AVR\LIBRARIES\SPI\SRC
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\TOOL-UNITY
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\TOOLCHAIN-ATMELAVR\LIB\GCC\AVR\5.4.0\INCLUDE
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\TOOLCHAIN-ATMELAVR\LIB\GCC\AVR\5.4.0\INCLUDE-FIXED
C:\USERS\WAPJOE.PLATFORMIO\PACKAGES\TOOLCHAIN-ATMELAVR\AVR\INCLUDE
Defines:
PLATFORMIO=40100
ARDUINO_AVR_PRO
F_CPU=16000000L
ARDUINO_ARCH_AVR
ARDUINO=10808
AVR_ATmega328P
Standard Version: c++11
IntelliSense Mode: gcc-x64
Other Flags:
—g++
—gnu_version=50400
Total Memory Usage: 19 MB

Понравилась статья? Поделить с друзьями:
  • Обнаружены ошибки error
  • Обнаружена следующая ошибка служба не запущена 0x80070426
  • Обнаружение и исправление ошибок реферат
  • Обнаружение и исправление ошибок на канальном уровне
  • Обнаружена следующая ошибка сервер rpc недоступен 0x800706ba