C ++ snacks: in VC, forceinclude is used to forcibly include stdafx. h.

Source: Internet
Author: User
ArticleDirectory
    • Forcereceivdes
    • References

In VC programming, the VC compiler provides the pre-compilation function to accelerate compilation. That is, in CPPCodeIncluding stdafx. H, you can use the pre-compilation.

As follows:

 
# Include"Stdafx. H"ClassDemo{Public:Demo(Void);~Demo(Void);};

Note: # include "stdafx. h" is manually written. It is not available by default.

Therefore, sometimes this will always happen, And the compiler will report an error at this time:

Error 1 fatal error c1010: unexpected end of file while looking for precompiled header. Did you forget to add' # include "stdafx. H" 'to your source? D: \ 3_code \ Vc \ forceincludedemo \ demo. cpp 11

It would be nice if stdafx. h could be pre-compiled.

 

Forcereceivdes

After some searches, I found that a/FI (name forced include file) option is provided in the compiler.

This option can be used to avoid such a situation.

This parameter is set in the "properties" dialog box of the project, specifically the force nodes attribute in advanced under C ++.

 

 

References

/FI (name forced include file)

Http://msdn.microsoft.com/en-us/library/8c5ztk84.aspx

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.