QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 641|回复: 1

magiclinux 1.1 gcc3.2.2 编译c++?

[复制链接]
发表于 2004-2-13 17:10:06 | 显示全部楼层 |阅读模式
[han@localhost han]$ gcc hello.cpp
/tmp/ccxATwv8.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/ccxATwv8.o(.text+0x21): In function `main':
: undefined reference to `std::cout'
/tmp/ccxATwv8.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/ccxATwv8.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/ccxATwv8.o(.text+0x5c): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccxATwv8.o(.text+0x8b): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccxATwv8.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

源程序:

#include <iostream>
using namespace std;
int main()
{
        cout &lt;&lt; "hello!" &lt;&lt; endl;
}
发表于 2004-2-13 18:29:36 | 显示全部楼层
g++
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-8 22:41 , Processed in 0.050799 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表