在使用CodeLite编译动态库的时候,可以通过在Linker > Linker Options中添加:

  -install_name @executable_path/libXXX.so

的方式更改动态库的Install Name。

在控制台中输入man ld之后, 会显示ld的帮助信息。其中包含-install_name参数的详细描述:

-install_name name

Sets an internal "install path" (LC_ID_DYLIB) in a dynamic library. Any clients linked against the library will

record that path as the way dyld should locate this library.  If this option is not specified, then the -o path

will be used.  This option is also called -dylib_install_name for compatibility.

在类Unix系统下,动态库的名字应该以“lib”开头。在应用程序链接阶段,如果想链接一个动态库,需以去掉“lib”和扩展名后的库名来进行链接。比如,如果要链接一个名为libXXX.so的动态库,需要通过设置-lXXX来进行链接。

参考

https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html

http://www.eyrie.org/~eagle/notes/rpath.html

http://thecourtsofchaos.com/2013/09/16/how-to-copy-and-relink-binaries-on-osx/

http://osiris.laya.com/coding/dylib_linking.html

https://www.mikeash.com/pyblog/friday-qa-2009-11-06-linking-and-install-names.html

Shared Library Search Paths的更多相关文章

  1. $(inherited) "$(SRCROOT) 修改.a文件的路径 --Library Search Paths

    $(inherited) "$(SRCROOT)/.a文件所在的文件名" //如果有多个.a文件格式就像这样 $(inherited) "$(SRCROOT)/xxxx& ...

  2. Linux Programe/Dynamic Shared Library Entry/Exit Point && Glibc Entry Point/Function

    目录 . 引言 . C/C++运行库 . 静态Glibc && 可执行文件 入口/终止函数 . 动态Glibc && 可执行文件 入口/终止函数 . 静态Glibc & ...

  3. eclipse报错:Failed to load the JNI shared library

    Eclipse运行时提示“Failed to load the JNI shared library /Java/jre6/bin/client/jvm.dll”的一个解决方案 因为 Eclipse ...

  4. Eclipse - Failed to load the JNI shared Library (JDK)

    When I try opening Eclipse, a pop-up dialog states: Failed to load the JNI shared library "C:/J ...

  5. 启动Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误

    启动Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误,如下 原因:eclipse的版本与jre或者jdk版本不 ...

  6. dynamic-link library shared library of functions and resources

    https://msdn.microsoft.com/en-us/library/1ez7dh12.aspx A dynamic-link library (DLL) is an executable ...

  7. Eclipse:启动时提示"Failed to load the JNI shared library"的解决方案

    今天打开Eclipse,弹出提示框"Failed to load the JNI shared library" 原因1:给定目录下jvm.dll不存在. 对策:(1)重新安装jr ...

  8. 64位操作系统弹出"Failed to load the JNI shared library “E:/2000/Java/JDK6/bin/..jre/bin/client/jvm.dll”

    64位操作系统弹出"Failed to load the JNI shared library /..jre/bin/client/jvm.dll”,最大的可能就是jdk的版本问题.去你的C ...

  9. Eclipse之Failed to load the JNI shared library”……\jvm.dll”的解决方案

    问题描述:java环境变量配置完全正确,但是运行eclipse时提示:Failed to load the JNI shared library " xxx\jva.dll" 原因 ...

随机推荐

  1. Spring-程序中获取注册bean的方式

    获得spring里注册Bean的四种方法,特别是第三种方法,简单: 一:方法一(多在struts框架中)继承BaseDispatchAction  import com.mas.wawacommuni ...

  2. Eclipse中使用SVN

    1.在Eclipse里下载Subclipse插件   方法一:从Eclipse Marketplace里面下载 具体操作:打开Eclipse --> Help --> Eclipse Ma ...

  3. Spring常用注解,自动扫描装配Bean

    1 引入context命名空间(在Spring的配置文件中),配置文件如下: xmlns:context="http://www.springframework.org/schema/con ...

  4. 【POJ 1679】The Unique MST(次小生成树)

    找出最小生成树,同时用Max[i][j]记录i到j的唯一路径上最大边权.然后用不在最小生成树里的边i-j来替换,看看是否差值为0. #include <algorithm> #includ ...

  5. 【POJ 2826】An Easy Problem?!(几何、线段)

    两个木条装雨水能装多少. 两线段相交,且不遮盖的情况下才可能装到水. 求出交点,再取两线段的较高端点的较小值h,(h-交点的y)为三角形的高. 三角形的宽即为(h带入两条线段所在直线得到的横坐标的差值 ...

  6. js base64位和c# Base64位转换

    <script> /* 编码规则 Base64编码的思想是是采用64个基本的ASCII码字符对数据进行重新编码. 它将需要编码的数据拆分成字节数组. 以3个字节为一组.按顺序排列24 位数 ...

  7. GraphX 的属性图

    package main.scala import org.apache.spark.graphx.{Edge, Graph, VertexId} import org.apache.spark.rd ...

  8. 61.Android适配的那些P事(转)

    转载:http://www.jianshu.com/p/29ef8d3cca85 首先我们看看百度搜索引擎上常见的认识入手: 图1:屏幕分辨率和常见屏幕密度关系 我们知道屏幕密度直接关系到我们所谓的1 ...

  9. [bzoj1911][Apio2010]特别行动队

    Description 有个元素,可以将个元素分成多组,每组的元素编号必须是连续的. 设每组的为,则每组的价值公式为. 求最大价值和. Input 输入由三行组成. 第一行包含一个整数,表示士兵的总数 ...

  10. 【caffe】epoch,[batch_size],iteration的含义

    @tags caffe 概念 一个epoch表示"大层面上的一次迭代",也就是指,(假定是训练阶段)处理完所有训练图片,叫一个epoch 但是每次训练图片可能特别多,内存/显存塞不 ...