Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Arduino (Not CLI), Can't include header file in root of project #1389

Open
@thewh1teagle

Description

@thewh1teagle

Hello
I try to include simple header file in the root of the project and upload it to the arduino using vscode. (ESP8266)
I have two files in the project

src/main.ino
#include "test.h"
void setup(){}
void loop(){}
src/test.h
#define TEST "test"

When I try to verify it (using vscode command)
image

I get this

error
Loading configuration...
Initialising packages...
Preparing boards...
Verifying...
main:12:10: fatal error: test.h: No such file or directory
1 | #include "test.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
exit status 1
.vscode/settings.json
{
      "arduino.path": "C:\\Users\\User\\Downloads\\arduino-1.8.16-windows\\arduino-1.8.16",
      "arduino.commandPath": "arduino.exe",
      "C_Cpp.default.browse.path": [
          "C:\\Users\\User\\Documents\\Arduino\\libraries",
          "C:\\Users\\User\\Downloads\\arduino-1.8.16-windows\\arduino-1.8.16\\libraries\\**",
          "C:\\Users\\User\\AppData\\Local\\Arduino15\\packages\\**",
          "${workspaceFolder}"
      ],
      "C_Cpp.default.includePath": ["C:\\Users\\User\\Desktop\\arduino_app\\src\\**"],
      "C_Cpp.default.browse.databaseFilename": "",
      "C_Cpp.intelliSenseEngine": "Tag Parser",
      "C_Cpp.intelliSenseEngineFallback": "Disabled",
    "C_Cpp.default.compilerArgs": [
        "-I ${workspaceFolder}\\src"
    ],
    "C_Cpp.default.intelliSenseMode": "msvc-x64",
    "C_Cpp.default.browse.limitSymbolsToIncludedHeaders": false,
    "C_Cpp.default.defines": ["ARDUINO=100"],
    "C_Cpp.default.forcedInclude": ["C:\\Users\\User\\Desktop\\arduino_app\\src\\test.h"]   
}
.vscode/arduino.json
{
    "configuration": "xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dout,eesz=1M64,led=2,sdk=nonosdk_190703,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
    "board": "esp8266:esp8266:generic",
    "sketch": "src\\main.ino",
    "port": "COM3",
    "output": "src\\dist"
}

platform: windows 11 x64
extension version: 0.4.8
arduino ide version1.8.16
vscode version 1.62.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions