Enable C++17 on Eclipse to Use `Std: :Byte`
I Want to Use #Include and Std: :Byte from C++17 on Eclipse Photon. I Have Configured the Project to Compile Using C++17 >> Project >> Properties >> C/C++...
I want to use #include <cstddef> and std::byte from c++17 on eclipse photon. I have configured the project to compile using c++17 >> project >> properties >> C/C++ Build >> settings >> GCC C++ Compiler >> Dialect >> Other dialect flags >> -std=c++17 and I have also tried -std=c++1z. My program below can use <cstddef> library, but the line with std::byte does not compile. Eclipse says Type 'std::byte' could not be resolved.
How do I make eclipse support C++17?
#include <cstddef>
int main(void) {
std::byte myByte { 2 };
}
Thanks
2 Answers
I use (eclipse 4.7.3a and gcc 7.3.0 MinGW-W64).
And C++17 works fine with flag --std=c++1z
project >> properties >> C/C++ Build >> settings >> GCC C++ Compiler >> Dialect >> Other dialect flags >> --std=c++1z
According to ,std::byte is only supported since gcc 7.
Try upgrade your gcc version