Closed EthanGuo1995 closed 4 years ago
Hi @EthanGuo1995 ! I see here two possible issues:
build_unflags = -std=c++14
looks like you've disabled a wrong standard flag, it should be build_unflags = -std=gnu++14
build_flags = ... -std=c++17 -std=gnu++11 ...
you've specified two different standards, the compiler will use the latter one. If you need C++17 specify only -std=c++17
or if you need C++17 with GNU extensions then -std=gnu++17
Hi @EthanGuo1995 ! I see here two possible issues:
build_unflags = -std=c++14
looks like you've disabled a wrong standard flag, it should bebuild_unflags = -std=gnu++14
build_flags = ... -std=c++17 -std=gnu++11 ...
you've specified two different standards, the compiler will use the latter one. If you need C++17 specify only-std=c++17
or if you need C++17 with GNU extensions then-std=gnu++17
It works!!! Thanks a lot.
Q: In my project, I wanna change the default g++ standard(g++14) into another one: c++17.
My platformio.ini file shown as follows:
But it did not work, showing
"cStandard": "c11", "cppStandard": "c++14"
in .vscode\c_cpp_properties.json fie as well, and the warning message lilke "warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
" .With my poor knowlege about gcc compiler and stuff... I wonder what the issue caused this warning. GCC compiler version maybe??