注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

一粒浮尘

飘渺虚无

 
 
 

日志

 
 

Dynamic linker is unable to find GCC libraries  

2014-07-19 15:29:13|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

https://gcc.gnu.org/faq.html

Dynamic linker is unable to find GCC libraries

This problem manifests itself by programs not finding shared libraries they depend on when the programs are started. (This often shows around libstdc++.)

GCC does not specify a runpath so that the dynamic linker can find dynamic libraries at runtime.

The short explanation is that if you always pass a -R option to the linker, your programs become dependent on directories which may be NFS mounted, and programs — even those which do not require these directories — may hang unnecessarily when an NFS server goes down. (SunOS effectively always passed a -R option for every -L option; this was a bad idea, and it was removed for Solaris.)

However, if you feel you really need such an option to be passed automatically to the linker, you may add it to a GCC specs file. This file can be created using gcc -dumpspecs and passed to GCC using the -specs= option. You may add linker flags such as -R or -rpath, depending on platform and linker, to the *link or *lib specs.

Alternately the syntax -Wl,option can be used to ask GCC to transfer the flag option to the linker.

Another alternative is to install a wrapper script around gcc, g++ or ld that adds the appropriate directory to the environment variable LD_RUN_PATH or equivalent (again, it's platform-dependent).

  评论这张
 
阅读(99)| 评论(2)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017