VC2005编译一个Hello,World通不过?

pp_dll 2007-06-23 09:38:45

#include <iostream>
using namespace std;

void main()
{
cout<<"Hello,C++"<<endl;
}




d:\program files\microsoft visual studio 8\vc\include\cstdlib(23) : error C203
9: 'exit' : is not a member of '`global namespace''

d:\program files\microsoft visual studio 8\vc\include\cstdlib(23) : error C287
3: 'exit' : symbol cannot be used in a using-declaration
...全文
587 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
guojl 2007-07-20
  • 打赏
  • 举报
回复
我也可以通过。
smile_sky 2007-07-20
  • 打赏
  • 举报
回复
加个 using namespace std;

或 std::cout<<"Hello,C++"<<std::endl;
njdragonfly 2007-07-20
  • 打赏
  • 举报
回复
通过Visual Studio 2005命令提示工具来编译就行了
hzj629206 2007-07-19
  • 打赏
  • 举报
回复
不错,应该是你的VS系统有问题,我也可以通过。
Avoid 2007-07-13
  • 打赏
  • 举报
回复
估计lz在托管C++下编译。。。
yunxiang_myx 2007-07-13
  • 打赏
  • 举报
回复
经验证与代码无关,可能是你的VS系统有问题.
alphagm 2007-07-12
  • 打赏
  • 举报
回复
你的vs2005系统有问题!或者是路径设置的问题!
mtviceelf 2007-07-11
  • 打赏
  • 举报
回复
我的方法比较笨
#include <iostream>
using namespace std;

void main()
{
std::cout<<"Hello,C++"<<std::endl;
}
不知道这样行不行???
nicetom328 2007-07-11
  • 打赏
  • 举报
回复
可以运行的, winxp sp2, VS2005环境下试验过。
rick_chen 2007-07-10
  • 打赏
  • 举报
回复
应该是字符串编码的问题,ASNl和Unicode'编码
nihilsong 2007-07-10
  • 打赏
  • 举报
回复
你可以改成这样的代码试试:
#include <iostream>
using namespace std;

void main()
{
wcout<<L"Hello,C++"<<endl;
}
nihilsong 2007-07-10
  • 打赏
  • 举报
回复
我运行了你的代码,完全可以运行。
我的系统:winxpsp2+vsts2005+sp1
rainbowsoftware 2007-06-24
  • 打赏
  • 举报
回复
楼上正解
pp_dll 2007-06-23
  • 打赏
  • 举报
回复
请达人指教
huaboy2004 2007-06-23
  • 打赏
  • 举报
回复
#include <iostream>
#include <cstdlib>

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧