我尝试在 Ubuntu 中编译 C++。我在 Gedit 中编写代码,这是一个简单的 hello world 项目。我去终端运行它gcc helloworld.cc并弹出此消息:
/tmp/ccy83619.o: In function `main':
helloworld.cc:(.text+0xa): undefined reference to `std::cout'
helloworld.cc:(.text+0xf): 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/ccy83619.o: In function `__static_initialization_and_destruction_0(int, int)':
helloworld.cc:(.text+0x3d): undefined reference to `std::ios_base::Init::Init()'
helloworld.cc:(.text+0x4c): undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
这是什么意思,我该往哪里去?