# gcc alantop.cpp
/tmp/cchoAlDx.o: In function `__static_initialization_and_destruction_0(int, int                                                                             )’:
alantop.cpp:(.text+0x38): undefined reference to `std::ios_base::Init::Init()’
alantop.cpp:(.text+0x3d): undefined reference to `std::ios_base::Init::~Init()’
/tmp/cchoAlDx.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0′
collect2: ld returned 1 exit status

增加编译参数 -lstdc++

# gcc alantop.cpp -lstdc++

版权声明:本文为zhangzhm原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/zhangzhm/article/details/93862638