I have recently purchased the text "Programming: Principles and Practice Using C++" by Bjarne Stroustrup and have been following it through. I am currently stuck on an early project, where I need to output some strings of text. Using Visual Studio Community 2015 update 1, on a Windows 10 Lenovo Yoga 2 Pro laptop, I have attempted to compile the project but have ran into an error detailed:
"Cannot open precompiled header file: Debug\Finding the Upstairs Bathroom.pch': No such file or directory". The name of the project is aptly named "Finding the Upstairs Bathroom.cpp". Here is the code:
// I have the headers "stdafx.h" as well as this specific header lib
// Bjarne Stroustrup created and which I had linked
// called "../../std_lib_facilities.h", which contains the standard C++ lib functions.
(#) define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1
int main()`// Main function`
{
cout << "Take the key out of your right pants pocket\n"; // Outputs string of text
cout << "Unlock the front door of the house\n";
cout << "Open the front door and step inside\n";
cout << "Lock the front door using the key\n";
cout << "Move up the stairs, taking them two at a time\n";
cout << "Walk to the second door on the left and face it directly\n";
cout << "Using the door handle, turn it and push the door forward\n";
cout << "Enter the bathroom while leaving the door open behind you\n";
keep_window_open();
return 0;
}
I would be grateful if someone is able to figure out how to fix my error.
#include
#include
#include