KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
So I'm trying to get the clang compiler to work.. my natural first choice of program was the following extremely complex code: #include <iostream> using std::cout; using std::endl; /* hello world.cpp */ int main() { cout << "Hello, world!" << endl; return 0; } On the command line I did: clang helloworld.cpp and I get the following nice error: Undefined symbols for architecture x86_64: "std::ios_base::Init::~Init()", referenced from: ___cxx_global_var_init in cc-4iziZq.o "std::ios_base::Init::Init()", referenced from: ___cxx_global_var_init in cc-4iziZq.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 cc-4iziZq.o "std::cout", referenced from: _main in cc-4iziZq.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 cc-4iziZq.o "std::ostream::operator<<(std::ostream& (*)(std::ostream&))", referenced from: _main in cc-4iziZq.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) What is wrong? Thanks! -kstruct
Tags (comma-separated)
Save Edits
Cancel