Answers

I reproduced this issue on my side: after applied SP1 beta, VS2010 shows me the PCH error message. We can ignore this error because it doesn't affect build phase, however, we cannot take advantage of
intellisense.

All replies

The project itself was created from the Project Wizard, with the Precompiled Header option unchecked, and Empty Project checked. So, I can't include "stdafx.h", since it doesn't exist.

With that said, when I typed "#include <cstdio>", it's gone. So does any other C standard library header files.

Before installing Visual Studio 2010 SP1 Beta, "void main(){}" actually worked, with no errors and no IntelliSense errors. Now why is it mandatory for me to add a header at the top when typing the code: "void main(){}"?

I reproduced this issue on my side: after applied SP1 beta, VS2010 shows me the PCH error message. We can ignore this error because it doesn't affect build phase, however, we cannot take advantage of
intellisense.

You can fix this by setting your project to not use precompiled headers. This seems to be turned on whether you ask for it or not. Right click your project (not solution, but project) and click "Properties". In the Project Property pages,
look under "Configuration Properties", "C/C++", "Precompiled Headers". Leaving the value blank is not sufficient. You must select "Not Using Precompiled Headers". Poof, problem goes away.

You can fix this by setting your project to not use precompiled headers. This seems to be turned on whether you ask for it or not. Right click your project (not solution, but project) and click "Properties". In the Project Property
pages, look under "Configuration Properties", "C/C++", "Precompiled Headers". Leaving the value blank is not sufficient. You must select "Not Using Precompiled Headers". Poof, problem goes away.

I prefer your answer to my answer, except that it does not seem to work for me.

I found that that putting anything with a # will also silence this particular IntelliSense warning.

I put #pragma at the top of the file, without any arguments. Warning silences.

#if 0

#endif

also silences the warning. This means that Visual Studio is not actually requiring an #include of a precompiled header. What Visual Studio is really requiring is a #.

I supposed that this might be a design flaw. It is widely perceived that in C++, there will always be a hashtag sign (#) at the very top of the source code file, whether it be the header files or the source files.

I don't know why it was designed this way. There could be comments, summaries, or possibly future Javadoc-similar variants (for C++17) that enables documentations within Intellisense that can be placed at the very top of the files.