undefined reference to `std::ios_base::Init::Init() 错误

zhao@ubuntu:~/date_struct/day01$ gcc 09tree.cpp
/tmp/ccRdJ54y.o: In function `__static_initialization_and_destruction_0(int, int)':
09tree.cpp:(.text+0x27): undefined reference to `std::ios_base::Init::Init()'
09tree.cpp:(.text+0x2c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccRdJ54y.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

cpp文件要用g++编译

错用为gcc会报如上错误

你可能感兴趣的:(undefined reference to `std::ios_base::Init::Init() 错误)