Earlier today I was prompted with a message in the terminal saying that some of my platforms need updating (specifically atmelavr
and nxplpc
).
So I ran platformio platform update
as prompted, and now my code is breaking.
The code I’m compiling is for the lpc11u68
board on the nxplpc
platform.
I’ve discovered that the problem is that __cplusplus
is less than 201103L
, which implies that the -std=c++11
flag isn’t being passed to the compiler, but I’ve got the flag included in my build_flags
in 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
; http://docs.platformio.org/page/projectconf.html
[env:lpc11u68]
platform = nxplpc
board = lpc11u68
framework = mbed
build_flags =
-DPOKITTO_PIO_BUILD
-Isrc
-std=c++11
extra_scripts = pre:pokitto_pre.py
I tried to downgrade by running platformio platform update nxplpc@3.3.0
but I got a ‘platform not recognised’ error.
If I put the following in my main.cpp
:
#if defined(__cplusplus)
#warning "You're on C++ at least"
#if __cplusplus > 201103L
#warning "C++11?"
#else
#warning "No C++11... :C"
#endif
#endif
I get the following in the terminal:
src\main.cpp:2:3: warning: #warning "You're on C++ at least" [-Wcpp]
#warning "You're on C++ at least"
^~~~~~~
src\main.cpp:6:4: warning: #warning "No C++11... :C" [-Wcpp]
#warning "No C++11... :C"
^~~~~~~
So evidently my platformio.ini
is either being ignored or there’s something not right with the env
settings.