How to compile C language with vs, compiler error c1853

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.