免费注册 查看新帖 |

Chinaunix

广告
  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1019 | 回复: 4
打印 上一主题 下一主题

gcc为何编译不了C++程序 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-12-06 20:06 |只看该作者 |倒序浏览
各位大哥,我的Linux为何不能编译C++程序,即使在书的原版程序,很简单的绝对没有错?

1101825310653_mthumb.jpg (98.79 KB, 下载次数: 21)

gcc为何编译不了C++程序

gcc为何编译不了C++程序

论坛徽章:
0
2 [报告]
发表于 2004-12-06 20:17 |只看该作者

gcc为何编译不了C++程序

因为gcc不能直接与C++的函数库连接,用g++可以

论坛徽章:
0
3 [报告]
发表于 2004-12-06 20:48 |只看该作者

gcc为何编译不了C++程序

俺也遇到这问题了,比如

  1. #include <iostream.h>;

  2. main()
  3. {
  4.   cout<<"hello,world!!!";
  5. }
复制代码


然后gcc hello.cpp -o hello报错:
gcc: hello: No such file or directory
In file included from /usr/include/c++/3.2.3/backward/iostream.h:31,
                 from hello.cpp:1:
/usr/include/c++/3.2.3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X>; header for the <X.h>; header for C++ includes, or <sstream>; instead of the deprecated header <strstream.h>;. To disable this warning use -Wno-deprecated.

论坛徽章:
0
4 [报告]
发表于 2004-12-08 16:14 |只看该作者

gcc为何编译不了C++程序

俺要怎么办啊,怎么没有人提携一下菜鸟~~~~~~~~~~~~~


--------------------------------------
菜鸟,学习中ing

论坛徽章:
5
荣誉会员
日期:2011-11-23 16:44:17CU大牛徽章
日期:2013-09-18 15:15:15CU大牛徽章
日期:2013-09-18 15:15:45未羊
日期:2014-02-25 14:37:19射手座
日期:2014-12-26 22:55:37
5 [报告]
发表于 2004-12-08 20:25 |只看该作者

gcc为何编译不了C++程序

你的c++程序写法太落后了。
早就改用
#include <iostream>;
using namespace std;
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP