COCALC c++ clang Errors
Whatever this means:
/WEEK1$ g++ hello.cpp
/WEEK1$ clang hello.cpp
/tmp/hello-e918fc.o: In function `main':
hello.cpp:(.text+0xa): undefined reference to `std::cout'
hello.cpp:(.text+0x24): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/hello-e918fc.o: In function `__cxx_global_var_init':
hello.cpp:(.text.startup+0x13): undefined reference to `std::ios_base::Init::Init()'
hello.cpp:(.text.startup+0x19): undefined reference to `std::ios_base::Init::~Init()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
~/WEEK1$ g++ hello.cpp -o hello
~/WEEK1$ ./hello
Hello World~/WEEK '
g++ complier works clang compiler not
add a comment