zoukankan      html  css  js  c++  java
  • boost regexpre 用于MFC时出现 'boost' : is not a class or namespace name错误

    错误的原因是把

    #include <boost/regex.hpp>

    放到了

    #includestdafx. h"

    之前

      is not a class or namespace name解决方法 收藏
     
    is not a class or namespace name解决方法
    每建立一个新类,都要在classname.cpp文件中加入#include "stdafx.h"文件,而且加的位置要在第一行;
    原因:编译器通过一个头文件stdafx.h来使用预编译头文件,所谓头文件预编译,就是把一个工程(Project)中使用的一些MFC 标准头文件(如Windows.H、Afxwin.H)预先编译,以后该工程编译时,不再编译这部分头文件,仅仅使用预编译的结果。这样可以加快编译速度,节省时间。 预编译头文件通过编译stdafx.cpp 生成,以工程名命名,由于预编译的头文件的后缀是“pch”,所以编译结果文件是projectname.pch。编译器通过一个头文件stdafx.h 来使用预编译头文件。stdafx.h 这个头文件名是可以在project 的编译设置里指定的。编译器认为,所有在指令#include "stdafx.h"前的代码都是预编译的,它跳过#includestdafx. h"指令,使用projectname.pch 编译这条指令之后的所有代码。
    因此,所有的CPP 实现文件第一条语句都是:#include "stdafx.h"。

    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jiangxinyu/archive/2008/07/03/2607113.aspx

  • 相关阅读:
    C 指针运算 指针访问数组
    C 字符串操作函数
    C putchar getchar
    C语言 指向函数的指针变量基础
    Openstack L2GW Plugin installation
    nova + ironic node
    cgroup
    ironic pxe tftp(二)Permission denied
    ironic bind port neutron port
    Failed to start OpenBSD Secure Shell server
  • 原文地址:https://www.cnblogs.com/cy163/p/1672260.html
Copyright © 2011-2022 走看看