The mistake here is to use the C ++ pre-compilation header to compile the C language.
What if the c1853 error is solved?
In fact, it is added to every. c file.
# Include "stdafx. H"
Change the. c file to the. cpp file.
Then
Change the user precompile header in the CREATE/use precompile header in the precompiled header in C/C ++ in configuration properties
Create precompile Header
How to compile C Programs with Microsoft Visual C ++ 2005
By default, newApplicationsCreated in Microsoft Visual C ++ 2005 express edition createC ++ Source code.
Here is how to compileCCode. LaunchVisual c ++ 2005 express EditionAnd create a new project. ChooseWin 32And win 32ConsoleApplication. Enter a name inNameBox below.
Now pressNextButton and thenFinishButton. This will generate a file calledName. Cpp whereNameIs your entered project name. Now look to the Solution Explorer (if you can't see it, click View on the menu then Solution Explorer), clickName. Cpp and press F2. now pressBackspaceTwice so you end upName. C.
PressF7ToCompile. If you get an error that say "Fatal error c1853: 'debug/name. PCH 'precompiled header file is from a previous version of the compiler, or the precompiled header is C ++ and you are using it from C (or vice versa) "Then just click the project menu, properties and changeCreate/use precompiled headerFromUse precompiled headerToCreate precompoiled Header. PressApplyButton. It shoshould now compile successfully when you pressF7.
Using existing code
Create an empty project as above and remove all lines except T
# Include "stdafx. H"
Then paste in your existing code after this include and save it. You shoshould now be able to compile (PressF7) And run your application.