Quote |
#include <iostream> using namespace std; int main() { cout << "hello world" << endl; return 0; } |
Quote |
/tmp/ccBMGhHB.o(.text+0x1b): In function `main': : undefined reference to `std::cout' /tmp/ccBMGhHB.o(.text+0x20): In function `main': : 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/ccBMGhHB.o(.text+0x28): In function `main': : undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' /tmp/ccBMGhHB.o(.text+0x30): In function `main': : undefined reference to `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> >&))' /tmp/ccBMGhHB.o(.text+0x59): In function `tcf_0': : undefined reference to `std::ios_base::Init::~Init [in-charge]()' /tmp/ccBMGhHB.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status |