Hello, I’m having a strange issue wit -I and -Idir build options, maybe I’m misunderstanding something, but from the manual:
https://docs.platformio.org/en/latest/projectconf/section_env_build.htm
-Idir CPPPATH Add the directory dir to the list of directories to be searched for header files.
Also I can’t find the doc where the -I flag is explained anymore.
Here’s my platformIO.ini:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
build_flags =
;-v; verbose compiling I can't remember why I had to use this once, but I'll keep it here just in case.
-I/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers
-I/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface
-I/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types
-Winline ;Warn when a function marked inline is not inlined.
;-Wno-reorder ; To ignore warnings about reordering on list initializers.
-Wno-pointer-arith ; To ignore warnings about casting void pointers, used on a couple of subroutines.
;-Werror=parentheses ; I can't remember why this is here.
;-save-temps
Here are the relevant errors in c_cpp_properties.json:
> "d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers",
> "d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface",
> "d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types",
> "d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers",
> "d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface",
> "d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types",
> "d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/headers",
> "d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/interface",
> "d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/types",
And here’s my full generated c_cpp_properties.json:
//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE “platformio.ini”:
// Redirecting...
//
{
“configurations”: [
{
“name”: “PlatformIO”,
“includePath”: [
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/include”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/src”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types”,
“d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers”,
“d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface”,
“d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/headers”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/interface”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/types”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/cores/arduino”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/variants/mega”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/HID/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/SPI/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/Wire/src”,
“”
],
“browse”: {
“limitSymbolsToIncludedHeaders”: true,
“path”: [
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/include”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/src”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types”,
“d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/headers”,
“d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/interface”,
“d:/d:/Projects/Autodriller-001/Software/AutoDrillerPanel/usr_lib/types”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/headers”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/interface”,
“d:/Projects/Autodriller-001/Software/AutoDrillerPanel/dir/usr_lib/types”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/cores/arduino”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/variants/mega”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/HID/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/SPI/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src”,
“C:/Users/Santiago/.platformio/packages/framework-arduino-avr/libraries/Wire/src”,
“”
]
},
“defines”: [
“PLATFORMIO=50100”,
“ARDUINO_AVR_MEGA2560”,
“F_CPU=16000000L”,
“ARDUINO_ARCH_AVR”,
“ARDUINO=10808”,
“AVR_ATmega2560”,
“”
],
“cStandard”: “c11”,
“cppStandard”: “c++11”,
“compilerPath”: “C:/Users/Santiago/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe”,
“compilerArgs”: [
“-mmcu=atmega2560”,
“”
]
}
],
“version”: 4
}
When I use the -I flag and add the full path manually vsCode is able to resolve that the libraries are there, but when I use the -Idir flag you can see it adds almost the same pat but it appends a dir/ at the start, also you can see how when i use -I/$PROJECT_DIR it duplicates the drive letter resulting in this d:/d:/
Are all these bugs? or am I not understanding something?