| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1492 人关注过本帖
标题:[讨论]关于头文件写法的疑惑
只看楼主 加入收藏
freshman42
Rank: 1
等 级:新手上路
威 望:1
帖 子:94
专家分:0
注 册:2005-12-4
收藏
 问题点数:0 回复次数:12 
[讨论]关于头文件写法的疑惑

#include<iostream.h>

#include<iostream>
using namespace std;
这两种写法我以前用都可以的 可是最近不知道为什么我用前面的那中写法 老是会出现以下的错误提示
d:\microsoft visual studio\vc98\include\streamb.h(90) : error C2027: use of undefined type 'ios'
d:\microsoft visual studio\vc98\include\streamb.h(67) : see declaration of 'ios'
d:\microsoft visual studio\vc98\include\streamb.h(90) : error C2061: syntax error : identifier 'seek_dir'
d:\microsoft visual studio\vc98\include\istream.h(64) : error C2504: 'ios' : base class undefined
d:\microsoft visual studio\vc98\include\istream.h(118) : error C2027: use of undefined type 'ios'
d:\microsoft visual studio\vc98\include\streamb.h(67) : see declaration of 'ios'
d:\microsoft visual studio\vc98\include\istream.h(118) : error C2061: syntax error : identifier 'seek_dir'
d:\microsoft visual studio\vc98\include\istream.h(118) : error C2535: 'class istream &__thiscall istream::seekg(long)' : member function already defined or declared
d:\microsoft visual studio\vc98\include\istream.h(117) : see declaration of 'seekg'
d:\microsoft visual studio\vc98\include\istream.h(140) : error C2664: 'class ios &(class ios &)' : cannot convert parameter 1 from 'class istream' to 'class ios &'
A reference that is not to 'const' cannot be bound to a non-lvalue
d:\microsoft visual studio\vc98\include\istream.h(155) : error C2065: 'lock' : undeclared identifier
d:\microsoft visual studio\vc98\include\istream.h(155) : error C2065: 'unlock' : undeclared identifier
d:\microsoft visual studio\vc98\include\ostream.h(59) : error C2504: 'ios' : base class undefined
d:\microsoft visual studio\vc98\include\ostream.h(95) : error C2027: use of undefined type 'ios'
d:\microsoft visual studio\vc98\include\streamb.h(67) : see declaration of 'ios'
d:\microsoft visual studio\vc98\include\ostream.h(95) : error C2061: syntax error : identifier 'seek_dir'
d:\microsoft visual studio\vc98\include\ostream.h(95) : error C2535: 'class ostream &__thiscall ostream::seekp(long)' : member function already defined or declared
d:\microsoft visual studio\vc98\include\ostream.h(94) : see declaration of 'seekp'
d:\microsoft visual studio\vc98\include\ostream.h(113) : error C2664: 'class ios &(class ios &)' : cannot convert parameter 1 from 'class ostream' to 'class ios &'
A reference that is not to 'const' cannot be bound to a non-lvalue
d:\microsoft visual studio\vc98\include\iostream.h(83) : error C2039: 'rdbuf' : is not a member of 'iostream'
d:\microsoft visual studio\vc98\include\iostream.h(66) : see declaration of 'iostream'
Error executing cl.exe.

main.obj - 15 error(s), 0 warning(s)
这是为什么呢???????

搜索更多相关主题的帖子: 文件 讨论 
2006-04-26 21:54
ElfDN
Rank: 4
等 级:贵宾
威 望:11
帖 子:291
专家分:0
注 册:2005-11-13
收藏
得分:0 

你换VC8了吧


2006-04-26 22:03
freshman42
Rank: 1
等 级:新手上路
威 望:1
帖 子:94
专家分:0
注 册:2005-12-4
收藏
得分:0 

我用的是VC6.0


2006-04-26 22:14
吾心永恒
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2006-4-23
收藏
得分:0 

重装一下吧

总会有问题的


我心永恒
2006-04-26 22:28
freshman42
Rank: 1
等 级:新手上路
威 望:1
帖 子:94
专家分:0
注 册:2005-12-4
收藏
得分:0 
不是吧 这样解决问题 那我还是用后面那种写法算了
不过那两中写法到底有没有什么区别?
它们各代表什么?

2006-04-26 22:36
激情依旧
Rank: 1
等 级:新手上路
威 望:2
帖 子:524
专家分:0
注 册:2005-4-4
收藏
得分:0 

I 在vc7里面是没有iostream.h这个文件的。所以你会出错。如果你在vc6.0里面,2个都是正确的。以后你用vc7的时候注意就是了


生是编程人!!!!死是编程鬼!!!!颠峰人生!!!焚尽编程!!! 爱已严重死机!情必须重新启动!情人已和服务器断开连接!网恋也需要重新拨号!-----激情依旧
2006-04-27 11:39
静思
Rank: 3Rank: 3
来 自:沈阳
等 级:新手上路
威 望:8
帖 子:630
专家分:0
注 册:2006-2-28
收藏
得分:0 
哦,原来这是版本不同所导致的呀!!!!我用的是VC6.0,所以这两种写法都可以。

英者自知,雄者自胜
2006-04-27 13:09
freshman42
Rank: 1
等 级:新手上路
威 望:1
帖 子:94
专家分:0
注 册:2005-12-4
收藏
得分:0 
以下是引用激情依旧在2006-4-27 11:39:00的发言:

I 在vc7里面是没有iostream.h这个文件的。所以你会出错。如果你在vc6.0里面,2个都是正确的。以后你用vc7的时候注意就是了

那就怪了
我一直用的是vc6.0的最近才出现这个错误的啊,好象是从我装了.net后就出现这个问题,会不会和这有关啊


2006-04-27 13:50
wfpb
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2188
专家分:0
注 册:2006-4-2
收藏
得分:0 
因为iostream.h是老板本的,现在都用iostream,

[glow=255,red,2]wfpb的部落格[/glow] 学习成为生活的重要组成部分!
2006-04-29 11:59
krisdy
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-6-13
收藏
得分:0 
恩,新旧版本不通导致的问题了
新版本不再支持后缀名了
2008-04-23 15:57
快速回复:[讨论]关于头文件写法的疑惑
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016546 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved