I can't compile first code in C++ in Visual Studio!

Try this, right click on your .uproject file and make sure you have the correct engine version selected. Then right click on the file again and hit “Generate Visual Studio Project Files”