Compile failed. This project could not be compiled. Would you like to open it in microsoft visual studio?

I was trying to use c++ and this error popped up (Compile failed. This project could not be compiled. Would you like to open it in microsoft visual studio?). And some more text after that. I hadn’t used c++ for some time and wanted to learn it but this error popped up. So how can I fix this?