-
Notifications
You must be signed in to change notification settings - Fork 229
Arduino (Not CLI), Can't include header file in root of project #1389
Comments
you can move the test.h to a sub folder like src/test/test.h and i think you have to modify the test.h file in definition line to #define TEST "test" |
@hdpklm |
@thewh1teagle For me i think is better for reorder all directory when I start a project but I have a quiestion. How you add the ocardion in github ?? .vscode/arduino.json
.vscode/c_cpp_properties.json
|
<details>
<summary>src/main.ino</summary>
```c
#include "test.h"
void setup(){}
void loop(){}
```
</details> This 👆, make this 👇 src/main.ino#include "test.h"
void setup(){}
void loop(){} |
ok thank you so mutch |
It is so stupid that herder files should be put in a sub-folder in order to make it works. |
If this is a known restriction, mentioning it in the Readme would be a first step. I opened #1561 for that. It has cost me some time to find this solution, and it nearly discouraged me to use this extension. |
Is there no way to handle my libraries? They have deeply nested subdirectories that assume proper IncludePaths? I.e., in lib/mylibary/somefile.h this now fails? |
im having i think a related issue, when i try to include a adafruit library which i installed through vs code, it still cant find it. does this issue apply to installed libraries as well? |
I found out why these problems occur. This problem is that the 'Custom Library' you want to add does not follow the location of 'Sketchbook Location' in Arduino Sketch's 'preferences', so you need to change 'otherLibrariesFolders' in the 'build.options.json' file. The C/C++ extension in VSCode cannot change the location of otherLibrariesFolders in Arduino Sketch. One way to solve this problem that I know of is to add the environment variable "ARDUINO_DIRECTORIES_USER" (on Windows it is solved by setting it to match the sketchbook directory at example: "E:\source\arduino") did. You need to restart vscode after setting. This method doesn't seem to be a good method. I've moved to Arduino-cli and configured it using a config file. |
Any news? |
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
src/test.h
When I try to verify it (using vscode command)
I get this
error
.vscode/settings.json
.vscode/arduino.json
platform:
windows 11 x64
extension version:
0.4.8
arduino ide version
1.8.16
vscode version
1.62.3
The text was updated successfully, but these errors were encountered: