错误 C2871:'std'不存在具有此名称的命名空间
error c2871: 'std' a namespace with this name does not exist
在我的项目中,我禁用了预编译的头。以下是代码示例。。
#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;
}
当我使用"使用命名空间std;"时,显示一个错误
error c2871: 'std' a namespace with this name does not exist
您应该改为#include <cstdio>
。
相关文章:
- C++:对不存在的命名空间使用命名空间指令
- 是否可以将函数导入命名空间,但不能导出它?
- 在 C++17 中的命名空间和子命名空间中重载运算符是不明确的
- 命名空间 std:: 不包含可选
- 有没有办法不使用命名空间中的项?
- 转发声明在命名空间中不起作用的替代方法
- 不使用与左右停止工作命名空间 std 的简单比较
- 为什么 std::variant 找不到运算符<() 当与比较类不在同一命名空间中时
- 有没有办法在不使用命名空间 std 或前缀 std:: 的情况下引用 cout?
- 如何为缺少预定义运算符而不扩展命名空间"std"的标准类型定义运算符>> (istream &, ...)?
- C++使用其他命名空间中的符号,而不使它们可从外部访问
- 命名空间中的unordered_map不会跨源文件"saving"其数据
- 如何在不使用命名空间标准的情况下取消设置ios::fixed
- 为什么不允许在全局命名空间处阻止范围?
- 枚举类不是类或命名空间
- 命名空间:不能在没有对象的情况下调用成员函数
- 'cv':构建时不存在具有此名称的命名空间(VS 2015,OpenCV 3.2)
- 如果存在具有不同参数类型的重载,则在全局命名空间中找不到函数
- 错误 C2871:'std'不存在具有此名称的命名空间
- 为什么以及如何在 CSTDlib 的全局和 std 命名空间中存在