error C2871: 'std' : does not exist or is not a namespace
#include <iostream.h>
using namespace std;
然后编译时出现 error C2871: 'std' : does not exist or is not a namespace
查了一下,原来 C++有两个不同版本号的头文件。引入名字空间这个概念曾经编译器用的是#include <iostream.h>,
而引入名字空间的概念以后std名字空间的头文件名称字变成了<iostream>。
<iostream.h>是比較老的C++的头文件的版本号,而namespace是98年才被增加C++标准的,所以<iostream.h>里面是没有std这么个命名空间的,当使用 <iostream.h>时,相当于在c中调用库函数,使用的是全局命名空间,也就是早期的c++实现。头文件<iostream>则未定义全局命名空间,使用时必须使用namespace
std才干正确使用cout。
vc6.0支持这个两个版本号. 只是如今都用<iostream>了
所以仅仅需将以上语句改为:
#include <iostream>
using namespace std;
或者是 #include <iostream.h>就可以。
error C2871: 'std' : does not exist or is not a namespace的更多相关文章
- 解决Eclipse中C++代码显示Symbol 'std' could not be resolved的问题
第一次在Eclipse中写C++代码,写了一个简单的hello world程序,还没有等我编译.就报出了各种错误,但是这么简单的代码.怎么可能这么多错误.于是没有理会.编译执行后,能够正常输出!!!H ...
- 【gradle报错】error: package org.apache.http does not exist
导入项目的时候gradle报错 error: package org.apache.http does not exist 解决方法: 在build.gradle中加入 android { use ...
- Error resolving template [xxx], template might not exist or might not be exist
Springboot+thymeleaf+mybatis 抛Error resolving template [xxx], template might not exist的异常 原因是我们在pom. ...
- Error 2 error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)'
Error 2 error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree ...
- Error resolving template: template might not exist or might not be accessible是一句缩水报错?
一 thymeleaf在开发的时候本地调试正常,但是在测试环境打成jar包就报这个错误了. 二 template might not exist or might not be accessible ...
- role 'PLUSTRACE' does not exist
I have created a new user named watson and granted the related priviledges as following: SQL> cre ...
- error: 'for' loop initial declarations are only allowed in C99 mode
error: 'for' loop initial declarations are only allowed in C99 mode 使用gcc编译代码是报出 error: 'for' loop i ...
- Error creating bean with name 'menuController': Injection of autowired dependency……
出现了一大串错误 Error creating bean with name 'userController': Injection of autowired dependencies failed. ...
- Error creating bean with name 'memcachedClient'...java.lang.OutOfMemoryError
1,Tomcat启动报错例如以下: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating ...
随机推荐
- openstack之nova-api服务流程分析
nova-api公布api服务没实用到一个些框架,基本都是从头写的.在不了解它时,以为它很复杂,难以掌握.花了两三天的时间把它分析一遍后,发现它本身的结构比較简单,主要难点在于对它所使用的一些类库不了 ...
- MySQL创建用户权限结果Trigger失败
说来惭愧,MySQL我已经在只将用于,非常赞赏阶段. 甚至一些比较深层次的管理,不熟悉如何,我们要加强啊! 最近.系统测试,使用MySQL数据库,你需要在表上创建触发器.该数据库是安装在机.但.在任何 ...
- DESCryptoServiceProvider加密解密的简单使用例子
DES.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using S ...
- 二叉树3种递归和非递归遍历(Java)
import java.util.Stack; //二叉树3种递归和非递归遍历(Java) public class Traverse { /******************一二进制树的定义*** ...
- 【设计优化】-使用缓冲(Buffer)提高程序性能
缓冲区是一块特定的内存区域.开辟缓冲区的目的是通过缓解应用程序上下层之间的性能差异,提高系统性能. 缓冲能够协调上层组件和下层组件的性能差异.当上层组件性能因为下层组件时,能够有效地降低上层组件对下层 ...
- 转: 第二章 IoC Annotation注入
http://blog.csdn.net/p_3er/article/details/9231307 1.命名空间 使用Annotation的方式,需要在spring的配置文件中配置命名空间.命名空间 ...
- Linux下如何查看高CPU占用率线程 LINUX CPU利用率计算(转)
Java 系统性能分析 命令 1. cpu分析 top , pidstat(sysstat) pid -p PID -t 1 10 vmstat 1 CPU上下文切换.运行队列.利用率 ps Hh - ...
- JAVA基础编程50题(10-12题)具体解释
一.描写叙述 1.一球从m米高度自由落下.每次落地后反跳回原高度的一半:再落下,求它在 第n次落地时.共经过多少米?第10次反弹多高? 2.有1.2.3.4个数字.能组成多少个互不同样且无反复数字的三 ...
- 使用X264编码yuv格式的视频帧使用ffmpeg解码h264视频帧
前面一篇博客介绍在centos上搭建点击打开链接ffmpeg及x264开发环境.以下就来问个样例: 1.利用x264库将YUV格式视频文件编码为h264格式视频文件 2.利用ffmpeh库将h264格 ...
- Performance Monitor采集性能数据
Performance Monitor采集性能数据 Windows本身为我们提供了很多好用的性能分析工具,大家日常都使用过资源管理器,在里面能即时直观的看到CPU占用率.物理内存使用量等信息.此外新系 ...