私は本の C++ コードを持っていて、Visual C++ Express 2010 で実行したいのですが、次のようなエラーが発生しました。このコードの実行方法を教えてください。どうもありがとう !
#include <iostream>
class Cat
{
public:
int itsAge;
int itsWeight;
};
int main()
{
Cat Frisky;
Frisky.itsAge = 5;
std::count << "Frisky is a cat who is ";
std::count << Frisky.itsAge << " years old.\n";
reutrn 0;
}
------ Build started: Project: chp6, Configuration: Debug Win32 ------
list6_1.cpp
list6_1.cpp(2): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
Add directive to 'StdAfx.h' or rebuild precompiled header
list6_1.cpp(20): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========