When boost regexpre is used in MFC, The 'boost ': is not a class or namespace name error occurs.

Source: Internet
Author: User

The error is caused

# Include <boost/RegEx. HPP>

 

Put it

 

# Define destdafx. H"

 

Before

 

Is not a class or namespace name solution favorites

Is not a class or namespace name Solution
Each time a new class is created, the # include "stdafx. H" file must be added to the classname. cpp file, and the position of the file must be in the first line;
Cause: the compiler uses a header file stdafx. h. h. afxwin. h) pre-compilation. Later, this header file will not be compiled and only the pre-compilation results will be used. This will speed up compilation and save time. The precompiled header file is generated by compiling stdafx. cpp and named after the project name. Because the precompiled header file is suffixed with "PCH", the compilation result file is projectname. PCH. The compiler uses the pre-compiled header file through a header file stdafx. h. The stdafx. h header file name can be specified in the project compilation settings. The compiler considers that allCodeAll are pre-compiled. It skips the # includestdafx. H "command and uses projectname. PCH to compile all the code after this command.
Therefore, the first statement of all CPP implementation files is: # include "stdafx. H ".

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/jiangxinyu/archive/2008/07/03/2607113.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.