注册 登录
编程论坛 C++教室

新手求教:发现错误后如何修改

多兰多 发布于 2012-01-22 22:56, 1077 次点击
#include <iostream>
using namespace std:
int main( )
{
    cout<<“Happy Spring Festival.”;
        return 0;
}
Cannot open include file: 'iostream': No such file or directory
执行 cl.exe 时出错.
12 回复
#2
尘仙森2012-01-23 00:25
结束符号是分号 ; 而不是冒号 :  还有符号要使用英文符号!
#3
多兰多2012-01-23 15:49
修改后的程序:
#include <iostream>
using namespace std;
int main( )
{
    cout<<“Happy Spring Festival.”;
        return 0;
}
还是运行不了啊,是不是软件或者是新建文件时出了问题啊
#4
bardon_20092012-01-24 13:25
中文引号“”,改成英文引号"",就OK了。
#5
闲出屁2012-01-24 13:44
baidu:
http://zhidao.baidu.com/question/310101630.html
baidu hi:
http://hi.baidu.com/xinkongqi/blog/item/b48df51fd0177768f624e491.html
#6
年少有点轻狂2012-01-24 13:46
#include <iostream>
using namespace std;
int main( )
{
    cout<<"Happy Spring Festival.";
        return 0;
}
#7
多兰多2012-01-24 15:59
还是不行啊,是不是软件出了问题
#8
闲出屁2012-01-24 18:23
以下是引用多兰多在2012-1-24 15:59:25的发言:

还是不行啊,是不是软件出了问题
那两个链接没解决你的问题?
#9
多兰多2012-01-24 21:06
没啊,前两个方法试过不行,第三个则是不明白什么意思:“每次编译之前先编译StdAfx.cpp,这样再编译就不会报错啦!”

#10
闲出屁2012-01-24 21:12
Cannot open include file: 'iostream': No such file or directory
还有这个?
前面加#include "stdafx.h"了么
有stdafx.h .cpp么
#11
多兰多2012-01-24 21:27
怎么加法,在#include<iostream>前加,还是直接改为#include "stdafx.h"
#12
bardon_20092012-01-28 09:55
在visual studio 2010 编译通过:

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}
///////////////////////上面是visual studio 2010 自带的。
#include <iostream>
using namespace std;
int main( )
{
    cout<<"Happy Spring Festival.";
        return 0;
}
#13
自由C2012-02-03 20:38
是你的括号的问题吧,用英文重新试一试
1