microsoft / vscode-arduino

Visual Studio Code extension for Arduino
Other
1.17k stars 223 forks source link

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

Open thewh1teagle opened 2 years ago

thewh1teagle commented 2 years ago

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 ```c #include "test.h" void setup(){} void loop(){} ```
src/test.h ```c #define TEST "test" ```

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

I get this

error ```bash 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 ```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 ```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

hdpklm commented 2 years ago

you can move the test.h to a sub folder like src/test/test.h and then change the include to the new path. its work for me.

and i think you have to modify the test.h file in definition line to #define TEST "test"

thewh1teagle commented 2 years ago

@hdpklm The test.h file was just an example. I edited this. This is Slightly crooked solution, but better than nothing :) Can you share your config files with your directory structure?

hdpklm commented 2 years ago

@thewh1teagle i dont have the .vscode/settings.json file 😐😐

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 ?? image

.vscode/arduino.json ``` { "board": "esp32:esp32:esp32", "port": "COM4", "sketch": "main.ino", "output": "0-build", "configuration": "PSRAM=disabled,PartitionScheme=min_spiffs,CPUFreq=240,FlashMode=dio,FlashFreq=80,FlashSize=2M,UploadSpeed=921600,DebugLevel=none" } ```
.vscode/c_cpp_properties.json ``` { "version": 4, "configurations": [ { "name": "Arduino", "compilerPath": "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\bin\\xtensa-esp32-elf-g++", "compilerArgs": [ "-std=gnu++11", "-Wpointer-arith", "-fexceptions", "-fstack-protector", "-ffunction-sections", "-fdata-sections", "-fstrict-volatile-bitfields", "-mlongcalls", "-nostdlib", "-Wno-error=maybe-uninitialized", "-Wno-error=unused-function", "-Wno-error=unused-but-set-variable", "-Wno-error=unused-variable", "-Wno-error=deprecated-declarations", "-Wno-unused-parameter", "-Wno-unused-but-set-parameter", "-Wno-missing-field-initializers", "-Wno-sign-compare", "-fno-rtti" ], "intelliSenseMode": "gcc-x64", "includePath": [ "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\config", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\app_trace", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\app_update", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\asio", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\bootloader_support", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\bt", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\coap", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\console", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\driver", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\efuse", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp-tls", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp32", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_adc_cal", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_event", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_http_client", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_http_server", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_https_ota", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_https_server", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_ringbuf", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp_websocket_client", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\espcoredump", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\ethernet", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\expat", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\fatfs", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\freemodbus", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\freertos", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\heap", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\idf_test", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\jsmn", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\json", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\libsodium", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\log", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\lwip", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\mbedtls", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\mdns", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\micro-ecc", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\mqtt", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\newlib", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\nghttp", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\nvs_flash", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\openssl", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\protobuf-c", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\protocomm", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\pthread", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\sdmmc", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\smartconfig_ack", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\soc", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\spi_flash", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\spiffs", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\tcp_transport", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\tcpip_adapter", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\ulp", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\unity", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\vfs", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\wear_levelling", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\wifi_provisioning", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\wpa_supplicant", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\xtensa-debug-module", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp-face", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp32-camera", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\esp-face", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\tools\\sdk\\include\\fb_gfx", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\cores\\esp32", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\variants\\esp32", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\EEPROM\\src", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\BluetoothSerial\\src", "C:\\Users\\Hassan Daoud\\Documents\\Arduino\\libraries\\CurveFitting\\src", "C:\\Users\\Hassan Daoud\\Documents\\Arduino\\libraries\\Adafruit_GFX_Library", "C:\\Users\\Hassan Daoud\\Documents\\Arduino\\libraries\\Adafruit_SSD1331_OLED_Driver_Library_for_Arduino", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\SPI\\src", "C:\\Users\\Hassan Daoud\\Documents\\Arduino\\libraries\\Adafruit_BusIO", "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\libraries\\Wire\\src", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\xtensa-esp32-elf\\include\\c++\\5.2.0", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\xtensa-esp32-elf\\include\\c++\\5.2.0\\xtensa-esp32-elf", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\xtensa-esp32-elf\\include\\c++\\5.2.0\\backward", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\lib\\gcc\\xtensa-esp32-elf\\5.2.0\\include", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\lib\\gcc\\xtensa-esp32-elf\\5.2.0\\include-fixed", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\xtensa-esp32-elf\\include", "c:\\users\\hassan daoud\\appdata\\local\\arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0\\xtensa-esp32-elf\\sysroot\\usr\\include" ], "forcedInclude": [ "C:\\Users\\Hassan Daoud\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.6\\cores\\esp32\\Arduino.h" ], "cStandard": "c11", "cppStandard": "c++11", "defines": [ "ESP_PLATFORM", "MBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"", "HAVE_CONFIG_H", "GCC_NOT_5_2_0=0", "WITH_POSIX", "F_CPU=240000000L", "ARDUINO=10810", "ARDUINO_ESP32_DEV", "ARDUINO_ARCH_ESP32", "ARDUINO_BOARD=\"ESP32_DEV\"", "ARDUINO_VARIANT=\"esp32\"", "ESP32", "CORE_DEBUG_LEVEL=0", "__DBL_MIN_EXP__=(-1021)", "__UINT_LEAST16_MAX__=0xffff", "__ATOMIC_ACQUIRE=2", "__FLT_MIN__=1.1754943508222875e-38F", "__GCC_IEC_559_COMPLEX=0", "__UINT_LEAST8_TYPE__=unsigned char", "__INTMAX_C(c)=c ## LL", "__CHAR_BIT__=8", "__UINT8_MAX__=0xff", "__WINT_MAX__=0xffffffffU", "__ORDER_LITTLE_ENDIAN__=1234", "__SIZE_MAX__=0xffffffffU", "__WCHAR_MAX__=0xffff", "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1", "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1", "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1", "__DBL_DENORM_MIN__=double(4.9406564584124654e-324L)", "__GCC_ATOMIC_CHAR_LOCK_FREE=2", "__GCC_IEC_559=0", "__FLT_EVAL_METHOD__=0", "__cpp_binary_literals=201304", "__GCC_ATOMIC_CHAR32_T_LOCK_FREE=2", "__UINT_FAST64_MAX__=0xffffffffffffffffULL", "__SIG_ATOMIC_TYPE__=int", "__DBL_MIN_10_EXP__=(-307)", "__FINITE_MATH_ONLY__=0", "__GNUC_PATCHLEVEL__=0", "__UINT_FAST8_MAX__=0xffffffffU", "__has_include(STR)=__has_include__(STR)", "__DEC64_MAX_EXP__=385", "__INT8_C(c)=c", "__UINT_LEAST64_MAX__=0xffffffffffffffffULL", "__SHRT_MAX__=0x7fff", "__LDBL_MAX__=1.7976931348623157e+308L", "__UINT_LEAST8_MAX__=0xff", "__GCC_ATOMIC_BOOL_LOCK_FREE=2", "__UINTMAX_TYPE__=long long unsigned int", "__DEC32_EPSILON__=1E-6DF", "__CHAR_UNSIGNED__=1", "__UINT32_MAX__=0xffffffffUL", "__LDBL_MAX_EXP__=1024", "__WINT_MIN__=0U", "__SCHAR_MAX__=0x7f", "__WCHAR_MIN__=0", "__INT64_C(c)=c ## LL", "__DBL_DIG__=15", "__GCC_ATOMIC_POINTER_LOCK_FREE=2", "__SIZEOF_INT__=4", "__SIZEOF_POINTER__=4", "__GCC_ATOMIC_CHAR16_T_LOCK_FREE=2", "__USER_LABEL_PREFIX__", "__STDC_HOSTED__=1", "__LDBL_HAS_INFINITY__=1", "__XTENSA_EL__=1", "__FLT_EPSILON__=1.1920928955078125e-7F", "__GXX_WEAK__=1", "__LDBL_MIN__=2.2250738585072014e-308L", "__DEC32_MAX__=9.999999E96DF", "__INT32_MAX__=0x7fffffffL", "__SIZEOF_LONG__=4", "__UINT16_C(c)=c", "__DECIMAL_DIG__=17", "__has_include_next(STR)=__has_include_next__(STR)", "__LDBL_HAS_QUIET_NAN__=1", "__GNUC__=5", "__GXX_RTTI=1", "__FLT_HAS_DENORM__=1", "__SIZEOF_LONG_DOUBLE__=8", "__BIGGEST_ALIGNMENT__=16", "__DBL_MAX__=double(1.7976931348623157e+308L)", "__INT_FAST32_MAX__=0x7fffffff", "__DBL_HAS_INFINITY__=1", "__INT64_MAX__=0x7fffffffffffffffLL", "__DEC32_MIN_EXP__=(-94)", "__INT_FAST16_TYPE__=int", "__LDBL_HAS_DENORM__=1", "__cplusplus=199711L", "__DEC128_MAX__=9.999999999999999999999999999999999E6144DL", "__INT_LEAST32_MAX__=0x7fffffffL", "__DEC32_MIN__=1E-95DF", "__DEPRECATED=1", "__DBL_MAX_EXP__=1024", "__DEC128_EPSILON__=1E-33DL", "__PTRDIFF_MAX__=0x7fffffff", "__GNUG__=5", "__LONG_LONG_MAX__=0x7fffffffffffffffLL", "__SIZEOF_SIZE_T__=4", "__SIZEOF_WINT_T__=4", "__GXX_ABI_VERSION=1009", "__FLT_MIN_EXP__=(-125)", "__INT_FAST64_TYPE__=long long int", "__FP_FAST_FMAF=1", "__DBL_MIN__=double(2.2250738585072014e-308L)", "__FLT_MIN_10_EXP__=(-37)", "__DEC128_MIN__=1E-6143DL", "__REGISTER_PREFIX__", "__UINT16_MAX__=0xffff", "__DBL_HAS_DENORM__=1", "__UINT8_TYPE__=unsigned char", "__NO_INLINE__=1", "__FLT_MANT_DIG__=24", "__VERSION__=\"5.2.0\"", "__UINT64_C(c)=c ## ULL", "__GCC_ATOMIC_INT_LOCK_FREE=2", "__FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__", "__INT32_C(c)=c ## L", "__DEC64_EPSILON__=1E-15DD", "__ORDER_PDP_ENDIAN__=3412", "__DEC128_MIN_EXP__=(-6142)", "__INT_FAST32_TYPE__=int", "__UINT_LEAST16_TYPE__=short unsigned int", "__INT16_MAX__=0x7fff", "__cpp_rtti=199711", "__SIZE_TYPE__=unsigned int", "__UINT64_MAX__=0xffffffffffffffffULL", "__INT8_TYPE__=signed char", "__ELF__=1", "__xtensa__=1", "__FLT_RADIX__=2", "__INT_LEAST16_TYPE__=short int", "__LDBL_EPSILON__=2.2204460492503131e-16L", "__UINTMAX_C(c)=c ## ULL", "__SIG_ATOMIC_MAX__=0x7fffffff", "__GCC_ATOMIC_WCHAR_T_LOCK_FREE=2", "__SIZEOF_PTRDIFF_T__=4", "__DEC32_SUBNORMAL_MIN__=0.000001E-95DF", "__INT_FAST16_MAX__=0x7fffffff", "__UINT_FAST32_MAX__=0xffffffffU", "__UINT_LEAST64_TYPE__=long long unsigned int", "__FLT_HAS_QUIET_NAN__=1", "__FLT_MAX_10_EXP__=38", "__LONG_MAX__=0x7fffffffL", "__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL", "__FLT_HAS_INFINITY__=1", "__UINT_FAST16_TYPE__=unsigned int", "__DEC64_MAX__=9.999999999999999E384DD", "__CHAR16_TYPE__=short unsigned int", "__PRAGMA_REDEFINE_EXTNAME=1", "__INT_LEAST16_MAX__=0x7fff", "__DEC64_MANT_DIG__=16", "__UINT_LEAST32_MAX__=0xffffffffUL", "__GCC_ATOMIC_LONG_LOCK_FREE=2", "__INT_LEAST64_TYPE__=long long int", "__INT16_TYPE__=short int", "__INT_LEAST8_TYPE__=signed char", "__DEC32_MAX_EXP__=97", "__INT_FAST8_MAX__=0x7fffffff", "__INTPTR_MAX__=0x7fffffff", "__EXCEPTIONS=1", "__LDBL_MANT_DIG__=53", "__DBL_HAS_QUIET_NAN__=1", "__SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)", "__INTPTR_TYPE__=int", "__UINT16_TYPE__=short unsigned int", "__WCHAR_TYPE__=short unsigned int", "__SIZEOF_FLOAT__=4", "__UINTPTR_MAX__=0xffffffffU", "__DEC64_MIN_EXP__=(-382)", "__INT_FAST64_MAX__=0x7fffffffffffffffLL", "__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1", "__FLT_DIG__=6", "__UINT_FAST64_TYPE__=long long unsigned int", "__INT_MAX__=0x7fffffff", "__INT64_TYPE__=long long int", "__FLT_MAX_EXP__=128", "__DBL_MANT_DIG__=53", "__INT_LEAST64_MAX__=0x7fffffffffffffffLL", "__DEC64_MIN__=1E-383DD", "__WINT_TYPE__=unsigned int", "__UINT_LEAST32_TYPE__=long unsigned int", "__SIZEOF_SHORT__=2", "__LDBL_MIN_EXP__=(-1021)", "__INT_LEAST8_MAX__=0x7f", "__WCHAR_UNSIGNED__=1", "__LDBL_MAX_10_EXP__=308", "__ATOMIC_RELAXED=0", "__DBL_EPSILON__=double(2.2204460492503131e-16L)", "__XTENSA_WINDOWED_ABI__=1", "__UINT8_C(c)=c", "__INT_LEAST32_TYPE__=long int", "__SIZEOF_WCHAR_T__=2", "__UINT64_TYPE__=long long unsigned int", "__INT_FAST8_TYPE__=int", "__DBL_DECIMAL_DIG__=17", "__DEC_EVAL_METHOD__=2", "__XTENSA__=1", "__ORDER_BIG_ENDIAN__=4321", "__cpp_runtime_arrays=198712", "__UINT32_C(c)=c ## UL", "__INTMAX_MAX__=0x7fffffffffffffffLL", "__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__", "__FLT_DENORM_MIN__=1.4012984643248171e-45F", "__INT8_MAX__=0x7f", "__UINT_FAST32_TYPE__=unsigned int", "__CHAR32_TYPE__=long unsigned int", "__FLT_MAX__=3.4028234663852886e+38F", "__INT32_TYPE__=long int", "__SIZEOF_DOUBLE__=8", "__cpp_exceptions=199711", "__INTMAX_TYPE__=long long int", "__DEC128_MAX_EXP__=6145", "__ATOMIC_CONSUME=1", "__GNUC_MINOR__=2", "__UINTMAX_MAX__=0xffffffffffffffffULL", "__DEC32_MANT_DIG__=7", "__DBL_MAX_10_EXP__=308", "__LDBL_DENORM_MIN__=4.9406564584124654e-324L", "__INT16_C(c)=c", "__STDC__=1", "__PTRDIFF_TYPE__=int", "__ATOMIC_SEQ_CST=5", "__UINT32_TYPE__=long unsigned int", "__UINTPTR_TYPE__=unsigned int", "__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD", "__DEC128_MANT_DIG__=34", "__LDBL_MIN_10_EXP__=(-307)", "__SIZEOF_LONG_LONG__=8", "__GCC_ATOMIC_LLONG_LOCK_FREE=1", "__LDBL_DIG__=15", "__FLT_DECIMAL_DIG__=9", "__UINT_FAST16_MAX__=0xffffffffU", "__GNUC_GNU_INLINE__=1", "__GCC_ATOMIC_SHORT_LOCK_FREE=2", "__UINT_FAST8_TYPE__=unsigned int", "__ATOMIC_ACQ_REL=4", "__ATOMIC_RELEASE=3", "USBCON" ] } ] } ```
thewh1teagle commented 2 years ago
<details>
  <summary>src/main.ino</summary>

```c
#include "test.h"
void setup(){}
void loop(){}
```
</details>

This πŸ‘†, make this πŸ‘‡

src/main.ino ```c #include "test.h" void setup(){} void loop(){} ```
hdpklm commented 2 years ago

@thewh1teagle

ok thank you so mutch

doyleLai commented 2 years ago

It is so stupid that herder files should be put in a sub-folder in order to make it works.
I am facing the same problem in VS code but my project works well with Arduino ide 1.8 and 2.0. This bug (or feature?) makes this extension entirely useless for me.

kopp commented 1 year ago

If this is a known restriction, mentioning it in the Readme would be a first step. I opened https://github.com/microsoft/vscode-arduino/pull/1561 for that. It has cost me some time to find this solution, and it nearly discouraged me to use this extension.

jleaders commented 1 year ago

Is there no way to handle my libraries? They have deeply nested subdirectories that assume proper IncludePaths?

I.e., in lib/mylibary/somefile.h assumes "lib/mylibary/" is in the include path so it does: #include "somefile2.h"

this now fails?

joecorsi commented 1 year ago

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?

Sudo42b commented 8 months ago

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.

AlessioSimone commented 6 months ago

Any news?