诸位朋友,我是一新手,手头只有一台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