PlatformIO Community

Build_flags: -Isomedir option not working

Hello, I’m trying to add an extra header directory to my project. I have added the following option to “platformio.ini” configuration file:

build_flags =
-IC:/Users/MORLUPIM/Dropbox/PlatformIO/Projects

After that, the compiler locates the new headers but it can’t find other library headers anymore. Looking at the compile command I noticed the following.

Before adding the option, the compile command looks like this:

avr-g++ -o .pio\build\nanoatmega328new\src\tcpchannel_test.cpp.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=atmega328p -DPLATFORMIO=40003 -DARDUINO_AVR_NANO -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO=10805 -Iinclude -Isrc -IC:\Users\MORLUPIM.platformio\lib\Low-Power_ID38 -IC:\Users\MORLUPIM.platformio\lib\OneWire_ID1 -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\libraries_cores_\arduino\SoftwareSerial\src -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\libraries_cores_\arduino\EEPROM\src -IC:\Users\MORLUPIM.platformio\lib\LoRa_ID1167\src -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\libraries_cores_\arduino\SPI\src -IC:\Users\MORLUPIM.platformio\lib\LiquidCrystal_PCF8574_ID1165\src -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\libraries_cores_\arduino\Wire\src -IC:\Users\MORLUPIM.platformio\lib\Time_ID44 “-IC:\Users\MORLUPIM.platformio\lib\DHT sensor library_ID19” “-IC:\Users\MORLUPIM.platformio\lib\Adafruit Unified Sensor_ID31” -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\cores\arduino -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\variants\eightanaloginputs src\tcpchannel_test.cpp

After adding the option the compile command is:

avr-g++ -o .pio\build\nanoatmega328new\src\tcpchannel_test.cpp.o -c -fno-exceptions -fno-threadsafe-statics -fpermissive -std=gnu++11 -Os -Wall -ffunction-sections -fdata-sections -flto -mmcu=atmega328p -DPLATFORMIO=40003 -DARDUINO_AVR_NANO -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO=10805 -Iinclude -Isrc “-IC:\Users\MORLUPIM.platformio\lib\DHT sensor library_ID19” “-IC:\Users\MORLUPIM.platformio\lib\Adafruit Unified Sensor_ID31” -IC:\Users\MORLUPIM\Dropbox\PlatformIO\Projects -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\cores\arduino -IC:\Users\MORLUPIM.platformio\packages\framework-arduinoavr\variants\eightanaloginputs src\tcpchannel_test.cpp

It seems the added include path replaces all the other include paths of the external libraries previously present in the compile command.

The documentation states that the -I option should be used to add extra include paths while it seems to actually replace them.