How to compile C sources using terminal?
Hi,
I've just started to learn bash and c++, so forgive me if my question is too lame.
I want to know how to compile a source file using terminal.
I tried: gcc hello.cpp
but I got this message:
Undefined symbols:
"___gxx_personality_v0", referenced from:
___gxx_personality_v0$non_lazy_ptr in ccC688qk.o
"std::ios_base::Init::~Init()", referenced from:
___tcf_0 in ccC688qk.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 ccC688qk.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccC688qk.o
"std::cout", referenced from:
__ZSt4cout$non_lazy_ptr in ccC688qk.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
What do I have to do to make things go in the right direction?
Thanks in advance
I've just started to learn bash and c++, so forgive me if my question is too lame.
I want to know how to compile a source file using terminal.
I tried: gcc hello.cpp
but I got this message:
Undefined symbols:
"___gxx_personality_v0", referenced from:
___gxx_personality_v0$non_lazy_ptr in ccC688qk.o
"std::ios_base::Init::~Init()", referenced from:
___tcf_0 in ccC688qk.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 ccC688qk.o
"std::ios_base::Init::Init()", referenced from:
__static_initialization_and_destruction_0(int, int)in ccC688qk.o
"std::cout", referenced from:
__ZSt4cout$non_lazy_ptr in ccC688qk.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
What do I have to do to make things go in the right direction?
Thanks in advance
iMac 2.66 GHz 2 GB, Mac OS X (10.5.5), XCode 3.1.1