1>test2.cpp(4): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>test2.cpp(12): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
precompiled header is a file that includes a bunch of commonly used files and other configurations. It is an optional thing you can do to reduce compilation times. It looks like your project is expecting to use a precompiled header. Here
are a couple options:
- Stop using precompiled headers: Project Properties -> C/C++ -> Precompiled Headers -> Not Using
- At the top of every .cpp file in the project, the first thing you should write is #include "stdafx.h", e.g.
cout << "Hi" << endl;