码迷,mamicode.com
首页 > 其他好文 > 详细

错误 undefined reference to __cxa_guard_acquire/release

时间:2016-03-17 07:05:55      阅读:354      评论:0      收藏:0      [点我收藏+]

标签:

用gcc编译 c++ 程序时,出现错误 undefined reference to __cxa_guard_acquire linker error, 但是用icc可以正常编译, 问题出在static 上。从网上搜到的解决办法是加库的链接:

To resolve this undefined references (__cxa_guard_acquire ) , add a library flag "-lstdc++" in your Makefile. It should work. It worked for me.
(http://rowley.zendesk.com/entries/46190-undefined-reference-to-cxa-guard-acquire-error-message)
加上后工作正常。

转自http://blog.sina.com.cn/s/blog_607233f50100xlml.html

 

在 gcc编译语句后添加-lstdc++即可。

如果出现其他未定义声明的情况:

undefined reference to `XXX‘
collect2: ld returned 1 exit status

同理添加-lxxx编译参数即可。

 

错误 undefined reference to __cxa_guard_acquire/release

标签:

原文地址:http://www.cnblogs.com/LarryGen/p/5285920.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!