I am having immense difficulty trying to use std::string. The program compiles absolutely fine, but when I run the program, I receive this error: error
I have looked everywhere on google and haven't found a thing on how to solve this issue. I have also tried writing my code differently to see if that would tell me anything.
std::string yourName;
std::cout << "What is your name?";
std::cin >> yourName;
std::cout << "Hello, " << yourName << std::endl;
Despite the rewrite, I am still getting the same exact error, and I am not forgetting to include the iostream and string header files.
I am using the GCC compiler and my compile code is g++ -std=c++14 test.cpp -o test.exe. I have also tried using the compile code g++ test.cpp -o test.exe. This did not fix the error.
I have asked this question before on Stack Overflow, but I failed to get a clear and understandable answer, most likely due to the fact that I am a complete beginner in programming. That being said, can someone please give me an answer on what might be causing this problem and how to fix it in plain English?