在使用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. 【BZOJ 1014】【JSOI 2008】火星人prefix

    看了<Hash在信息学竞赛中的一类应用>中的例题3,这道题很类似啊,只不过没有删点和区间翻转. 用Splay维护字符串哈希,加点改点什么的就不用说了,查询时二分答案,这样时间复杂度是$O( ...

  2. 【BZOJ 2809】【APIO 2012】dispatching

    昨天晚上zyf神犇问我的题,虽然我太弱参加不了APIO但也做一做吧. 用小数据拍了无数次总是查不出错来,交上去就WA,后来用国内数据测发现是主席树上区间相减的值没有用long long存,小数据真是没 ...

  3. 【BZOJ 2843】极地旅行社

    复习一下$LinkCutTree$的模板. #include<cstdio> #include<cstring> #include<algorithm> #defi ...

  4. sql insert into select语句写法-将查询结果直接插入到表中

    insert into month_gpcj_info(idStr,zszrmygpsl,xyzrmygpsl,mycje,mycjl,month_date,dataCompiledDate) sel ...

  5. EF异常:“System.InvalidOperationException”类型的未经处理的异常在 mscorlib.dll 中发生

     实体框架System.Data.Entity.SqlServer提供者类型”. SqlProviderServices EntityFramework. 的在应用程序配置文件注册状态"置疑 ...

  6. Java反编译插件JadClipse

    Java反编译是很容易的,现在就介绍一个反编译插件,以后我们通过Ctrl+鼠标左键查看源码就容易得多了,不用再担心源码找不到了,配置过程很简单的. 准备: 1.下载JadClipse(jar文件,ec ...

  7. MapReduce设置输出分隔符

    conf.set("mapred.textoutputformat.ignoreseparator","true"); conf.set("mapre ...

  8. ubuntu安装WPS

    自带的LiberaOffice略渣,还是安上WPS吧. 直接按官网上的sudo apt-get install ia32-libs根本无法运行.需要先做个补丁. 用sudo gedit打开编辑器,输入 ...

  9. glibc resolv/res_send.c getaddrinfo() buffer stack smash when dealing malformation big DNS Response Package

    catalogue . 漏洞简述 . 调试环境搭建 . 漏洞利用 . 漏洞分析 . 缓解修复方案 1. 漏洞简述 0x1: 函数调用顺序 getaddrinfo (getaddrinfo.c) -&g ...

  10. 最小生成树问题---Prim算法与Kruskal算法实现(MATLAB语言实现)

    2015-12-17晚,复习,甚是无聊,阅<复杂网络算法与应用>一书,得知最小生成树问题(Minimum spanning tree)问题.记之. 何为树:连通且不含圈的图称为树. 图T= ...