Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 错误c2871:“std”具有此名称的命名空间不存在_C++_Visual Studio 2008 - Fatal编程技术网

C++ 错误c2871:“std”具有此名称的命名空间不存在

C++ 错误c2871:“std”具有此名称的命名空间不存在,c++,visual-studio-2008,C++,Visual Studio 2008,在我的项目中,我禁用了预编译的标题。 下面是代码示例 #include <stdio.h> #include <conio.h> #include "Getfilelist.h" using namespace std; int main() { Getfilelist fl; int i = fl.GetFList("J:\\EDUCATION\\Mine\\seminar\\seminar-1"); getch(); return 0;

在我的项目中,我禁用了预编译的标题。 下面是代码示例

#include <stdio.h>
#include <conio.h>
#include "Getfilelist.h"

using namespace std;


int main()
{
    Getfilelist fl;
    int i = fl.GetFList("J:\\EDUCATION\\Mine\\seminar\\seminar-1");
    getch();
return 0;
}

您应该改为包含。

当您只包含C头时,为什么希望定义名称空间std?我只想知道这个错误的原因。我已经做了很多项目,包括标题和名称空间std,但这是我第一次遇到这个错误。谢谢你的解决方案。但我从一年前就开始使用VS2008了,以前从未遇到过名称空间“std”的问题。我可以知道此错误的原因吗?stdio.h可能无法在命名空间std中包装函数以实现向后兼容性。@user3615925您始终包括(可能是间接地)至少一个引入std命名空间的标头。
error c2871: 'std' a namespace with this name does not exist