免费注册 查看新帖 |

Chinaunix

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

[C++] 帮帮忙,c++编译出问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-01-04 21:11 |只看该作者 |倒序浏览
最近刚装了RH 9.0,以前都没有用过

今天试试C++编译却出错了

文件名:ctest.cpp

#include <iostream.h>;

int main()
{
cout<<"yes"<<endl;
return 0;
}


# cc ctest.cpp
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from ctest.cpp:1:
/usr/include/c++/3.2.2/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.
/tmp/ccBmTp05.o(.text+0x14): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char>; >;& std::endl<char, std::char_traits<char>; >;(std::basic_ostream<char, std::char_traits<char>; >;&'
/tmp/ccBmTp05.o(.text+0x21): In function `main':
: undefined reference to `std::cout'
/tmp/ccBmTp05.o(.text+0x26): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char>; >;& std:perator<< <std::char_traits<char>; >;(std::basic_ostream<char, std::char_traits<char>; >;&, char const*)'
/tmp/ccBmTp05.o(.text+0x2f): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char>; >;:perator<<(std::basic_ostream<char, std::char_traits<char>; >;& (*)(std::basic_ostream<char, std::char_traits<char>; >;&)'
/tmp/ccBmTp05.o(.text+0x5c): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccBmTp05.o(.text+0x8b): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccBmTp05.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status


这到底是怎么回事啊?

论坛徽章:
0
2 [报告]
发表于 2004-01-04 21:38 |只看该作者

帮帮忙,c++编译出问题

g++ ctest.cpp

论坛徽章:
0
3 [报告]
发表于 2004-01-04 21:41 |只看该作者

帮帮忙,c++编译出问题

thx,ok 了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP