首页 新闻 会员 周边 捐助

MacOS lion10.7.5下写C++ 编译出错

0
悬赏园豆:15 [已关闭问题] 关闭于 2012-11-27 05:18

诸位朋友,我是一新手,手头只有一台macbookpro,想学习C++,写了简单的hello,world入门代码,编译出错了,请指点迷津:)

错误提示如下:

$ gcc hello.cpp
Undefined symbols for architecture x86_64:
"std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))", referenced from:
_main in ccl2VB5r.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccl2VB5r.o
"std::ios_base::Init::~Init()", referenced from:
___tcf_0 in ccl2VB5r.o
"std::cout", referenced from:
_main in ccl2VB5r.o
"std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:
_main in ccl2VB5r.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
_main in ccl2VB5r.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

Adalous-阿达的主页 Adalous-阿达 | 菜鸟二级 | 园豆:202
提问于:2012-11-27 04:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册