免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-01-04 20:54 |只看该作者 |倒序浏览
最近刚装了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 23:41 |只看该作者

RH 9.0 C++编译出问题,帮忙!!

Step 1:

gpp-01.jpg (28.28 KB, 下载次数: 44)

gpp-01.jpg

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

RH 9.0 C++编译出问题,帮忙!!

Step 2:

gpp-02.jpg (50.71 KB, 下载次数: 38)

gpp-02.jpg

论坛徽章:
0
4 [报告]
发表于 2004-01-05 01:43 |只看该作者

RH 9.0 C++编译出问题,帮忙!!

#include <iostream>;
using namespace std;

不要用#include <iostream.h>;编译就OK了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP