在使用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. C++_直接插入排序

    #include <iostream> using namespace std; void insertSort(int a[], int n) {     for(int i=1;i&l ...

  2. Ibatis的环境搭建以及遇到的问题解决

    新建Java项目IbatisTest,加入Mysql和ibatis的驱动包; 在数据库中新建一张表student表,添加字段sid.sname.major.birth; 在java项目中添加bean对 ...

  3. EM算法

    EM算法的推导

  4. css3-新属性-用户界面

    多列:(对文本进行布局,像报纸那样) column-count: 规定元素应该被分隔得列数: column-gap:规定列之间的间距: column-rule: 列与列之间的间隔线: column-w ...

  5. tomcat提示警告: An attempt was made to authenticate the locked user"tomcat"

    启动tomcat7之后,运行正常,但是运行一段时间就会提示以下警告: 十二月 04, 2013 5:10:15 下午 org.apache.catalina.realm.LockOutRealm au ...

  6. Android Studio开发调试使用

    Android Studio调试其实也非常方便,一般问题直接通过AS的DDMS的Logcat就可以搞定.AS支持类似Eclipse的DDMS的所有功能.这里要说的是疑难问题的调试方式,即断点调试. 首 ...

  7. C#-WinForm-对话框控件

    对话框控件     设置点击按钮弹出对话框控件 1.colorDialog - 颜色对话框 接收确定返回的信息 ============================================ ...

  8. js window.open 打开新窗体 参数设置

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. 如何在iOS9的plist文件中配置不使用https

    App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Te ...

  10. windows下关闭进程

    1.首先查找到占用8080端口的进程号PID是多少 CMD>netstat -ano | findstr 8888 这个命令输出的最后一列表示占用8080端口的进程号是多少,这里是5880 2. ...