C++ std::system 'system' not a Member of std
Solution 1
std::system
is (and always has been) in <cstdlib>
.
It is not defined by the C++ standard whether standard headers include each other, and if so which ones. So it's possible that 3 years ago, on a different compiler or a different version of the same compiler, your code worked by accident, because one of the headers you include just so happened to include <cstdlib>
. On the compiler/version you're using now, it doesn't.
Solution 2
Do you have this?:
#include <cstdlib>
Solution 3
Make sure you have #include <cstdlib>
in your code.
Paradius
Updated on June 04, 2022Comments
-
Paradius almost 2 years
I receive an error compiling a C++ program in which of the lines makes a call from "std::system(SomeString)". This program compiled 3 years ago, but when compiling it today, I receive an error that states ‘system’ is not a member of ‘std’. Is there something that I must import to use std::system, has it been abandoned, or has it moved to another header file.
-
Danil Asotsky over 11 yearsWhat new information you answer give in compare with accepted one?