It’s likely it was only the IntelliSense error checker that wasn’t realising it should also look in that header file… if it compiles ok, but gets red underlines… it’s just IntelliSense not working properly… it happens sometimes, especially with more complex code… most times a rebuild of the intellisense cache livens it up, or sometimes extra includes are needed so it really does know where to find stuff.
However, both these flags are already defined in “c:/UsersUserf/Documents/PlatformIO/Projects/nrf52840-bt-thermometer/.pio/build/nrf52840_dk/mbed_config.h”.
Just checked c_cpp_properties.json and it contains correct path (“c:/Users/User/Documents/PlatformIO/Projects/nrf52840-bt-thermometer/.pio/build/nrf52840_dk”). I have no idea no idea why it doesn’t work.
Ok, so that is probably either a Library Dependency Finder issue where it didn’t process the preprocessor macros (i.e. it needs lib_ldf_mode = chain+ or lib_ldf_mode = deep+ so it processes the defines properly or digs deeper into the include chain)… or because you haven’t compiled yet, so IntelliSense doesn’t know which defines will be active as they don’t technically exist, hence the errors will typically go away after a compile as those macros have appeared during a compile. I have a similar problem with code that has conditional includes triggered by defines, and it goes away after a compile.