0

I'm just trying to understand how vscode can compile arduino sketch. Now I uploaded some sketch to arduino and it was fine. Now I'm trying to add my own header files to .ino sketch and I got weird faults. I don't understand whats happening. I know this header files in under project.

Project Files

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "chcStandart.h"
#include "chcDefines.h"

When I try to verify my code I get this error:

> c:\Users\Desktop\Main_Code\chc.h:7:25: fatal error: chcStandart.h: No
> such file or directory

Also ı configured my json (c_cpp_prop) file and it looks like that.

"name": "Win32",
            "includePath": [
                "C:\\Program Files (x86)\\Arduino\\tools\\**",
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\**",
                "C:\\Program Files (x86)\\Arduino\\libraries\\**",
                "C:\\Users\\Musa Ünal\\Documents\\Arduino\\libraries\\",
                "C:\\Users\\Musa Ünal\\Desktop\\Main_Code\\**"

            ],
            "forcedInclude": [
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino\\Arduino.h"
            ],
            "intelliSenseMode": "msvc-x64",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "C_Cpp.intelliSenseEngine": "Tag Parser"

My question is: How I can handle this problem? Thanks!

  • Where is the file chcStandart.h? The tool is looking for it at c:\Users\Desktop\Main_Code\chcStandart.h – jose can u c Jan 16 at 14:27
  • Yes, its under the project, same file with my .ino file – Musa Jan 16 at 14:30
  • do you have #include "chcStandard.h" or #include <chcStandard.h> in chc.h? – Juraj Jan 16 at 18:22
  • Ok problem solved, if anybody have the same problem you should add "${workspaceRoot}" to your path – Musa Jan 16 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.