I installed Qt through aqt (in my country you can’t set Qt). When I run this code i get an error:
#include <QCoreApplication>
#include <iostream>
#include <string>
void do_cpp() {
std::string name;
std::cout << "Please enter your name: ";
std::getline(std::cin, name);
std::cout << "Hello " << name << 'n';
}
int main(int argc, char *argv[]) {
do_cpp();
QCoreApplication a(argc, argv);
return a.exec();
}
`
an error appears on the line with first cout.
error: signal: SIGSEGV appointment: Segmentation fault
how to fix the error? The problem is most likely in the Qt itself. but I have no idea what to do.
New contributor
user25990034 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.