I am currently making a text-based adventure game like Zork but when I encountered this error in visual studio code for windows nothing I did could fix it I previously installed a C/C++ compiler. This is the code and the error message is:
“the preLanchTask ‘C/C++: g++.exe build active file’ terminated with exit code -1”
#include <iostream>
using namespace std;
int main () {
string playerName;
cout << "Hello!n"
<< "I am going to take you on a text adventure today!n"
<< "Sorry, I didn't get your name? n"
<< "You: My name is ";
cin >> playerName;
cout << "Wow, " <<playerName <<" is a cool name!";
return 0;
}
would anyone be willing to help me fix this?
I tried viewing the problems section of the terminal but it just said no problems were detected.
Ender Ford is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2