用向导建立MFC应用,在View类中想使用C++ 中的set<string>数据类型,在View.cpp中加入#include<set>,编译时出现Cannot open include file: 'set.h': No such file or directory,为什么?怎么解决?谢谢回答!

解决方案 »

  1.   

    VC2005下没问题
    VC6下混用MFC和STL好像不太容易你检查下路径设置呢
      

  2.   

    Cannot open include file: 'set.h'怎么会出现'set.h'?你的include写对了么?
      

  3.   

    哦,对了,把STL头文件的声明#include <set>
    using namespace std;放在在系统生成的代码#ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif之前试试看
      

  4.   

    控制台程序中写成#include<set>就可以,在MFC中,应写成#include <set.h>, 但写成#include <set.h> 或 #include "set.h"都试过了,结果都一样;如果写成#include <set>则出现很多与set相关的标示符未定义错误。
      

  5.   

    把STL头文件的声明#include <set.h>
    using namespace std;放在在系统生成的代码#ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif之前还是不行啊!
      

  6.   

    控制台程序中写成#include<set>就可以,在MFC中,应写成#include <set.h>___________
    这个跟什么类型的程序没有关系,而是使用的不同的头文件。#include<set>是标准的C++库的使用方式,你既然用STL,当然应该用这种方法。同时,怀疑有没有"set.h"这个文件存在
      

  7.   

    如果写成#include <set>则出现很多与set相关的标示符未定义错误。
    ___________________有没有 using namespace std; ?
      

  8.   

    有 using namespace std; 另外在C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE和
    C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE中确实没有set.h这个文件,只有个set文件。但在MFC程序中用#include<set>却不行!怎么弄?
      

  9.   

    #include <set.h>
    using namespace std;
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif编译报什么错?
      

  10.   

    #include <set.h>
    using namespace std;
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;
    #endif编译报fatal error C1083: Cannot open include file: 'set.h': No such file or directory