undefined reference to `std::ios_base::Init::Init()'错误的解决方案

网友投稿 358 2022-09-01

undefined reference to `std::ios_base::Init::Init()'错误的解决方案

# 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++

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Visual Studio 2017 (vs2017)安装硬件和软件要求
下一篇:c++从标头和标尾提取数据
相关文章

 发表评论

暂时没有评论,来抢沙发吧~