[Solved] Impossible declare string type in C++


The hint is in the warnings: the #include <string> is ignored because it’s apparently after the include of the precompiled header file. Make sure the precompiled header is included first.

Background: If the corresponding project setting is enabled, the Visual C++ Compiler will, in a pre-preprocesser step, replace the line #include "stdafx.h" (this is the default name for the file, it can be changed) with some proprietary blob that contains the content of the stdafx.h in a preprocessed form that the compiler can process more quickly than the actual text content. For this to be useful, the context in which the precompiled header file is used has to be identical to the context it was created in. The Visual C++ Compiler enforces this by simply scrapping everything that comes before the include of the precompiled header.

1

solved Impossible declare string type in C++