代码: 全选
/tmp/ccgS00Qz.o: In function `__static_initialization_and_destruction_0(int, int)':
helloworld.cc:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccgS00Qz.o: In function `__tcf_0':
helloworld.cc:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccgS00Qz.o: In function `main':
helloworld.cc:(.text+0x8e): undefined reference to `std::cout'
helloworld.cc:(.text+0x93): 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/ccgS00Qz.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
代码: 全选
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!";
}