#Error with std::byte

36 messages · Page 1 of 1 (latest)

vital bolt
#

Hi guys, I'm getting an error with std::byte, I have the right includes

#include <iostream>
#include <cstddef>

but it gives me that error saying that there is no byte member
what can I do?

main kernelBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

vital bolt
#

I read in internet that byte member was added at C++17, but the code was made in that version and is compiling with that version (using Makefile)

hushed roost
#

CC is the compiler command, not the flags... I'm not sure if that would work

#

can you show your full makefile

#

Actually, is this vscode? try compiling with make

#

this is probably just a config issue in vscode

vital bolt
#

i'm compiling using make at the terminal yes

#

and gives me this error too

hushed roost
#

That looks fine... do g++ --version

vital bolt
hushed roost
#

that's a really old version of the compiler

#

it probably doesn't support those C++17 changes

#

(17 means 2017.... your copyright says 2016 😄 )

hushed roost
#

You probably installed the original mingw project, which has been discontinued

vital bolt
#

this is the makefile

#

ohh

hushed roost
#

MinGW-w64 is the continued project

#

and is updated to GCC 13

#

and just go into where you previously installed mingw and replace it

vital bolt
#

hmm

#

ok let me try

#

btw, why posix one?

#

and not windows?

#

ok it worked!!!

#

thank you so much :3

hushed roost
vital bolt
#

oh ok

hushed roost
#

glad you got it working and your compiler updated 🙂

#

Note that you can even use C++20 now too

vital bolt
#

yeah!

#

we usually use at classes the C++17 but I was using CLion at that time (and it uses the inbuilt mingw). So now that I went to another project and come to VSCode I forgot about the version xD

main kernelBOT
#

@vital bolt Has your question been resolved? If so, type !solved :)

vital bolt
#

!solved