Shared Library Search Paths
在使用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的更多相关文章
- $(inherited) "$(SRCROOT) 修改.a文件的路径 --Library Search Paths
$(inherited) "$(SRCROOT)/.a文件所在的文件名" //如果有多个.a文件格式就像这样 $(inherited) "$(SRCROOT)/xxxx& ...
- Linux Programe/Dynamic Shared Library Entry/Exit Point && Glibc Entry Point/Function
目录 . 引言 . C/C++运行库 . 静态Glibc && 可执行文件 入口/终止函数 . 动态Glibc && 可执行文件 入口/终止函数 . 静态Glibc & ...
- eclipse报错:Failed to load the JNI shared library
Eclipse运行时提示“Failed to load the JNI shared library /Java/jre6/bin/client/jvm.dll”的一个解决方案 因为 Eclipse ...
- 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 ...
- 启动Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误
启动Eclipse 弹出"Failed to load the JNI shared library jvm.dll"错误,如下 原因:eclipse的版本与jre或者jdk版本不 ...
- 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 ...
- Eclipse:启动时提示"Failed to load the JNI shared library"的解决方案
今天打开Eclipse,弹出提示框"Failed to load the JNI shared library" 原因1:给定目录下jvm.dll不存在. 对策:(1)重新安装jr ...
- 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 ...
- Eclipse之Failed to load the JNI shared library”……\jvm.dll”的解决方案
问题描述:java环境变量配置完全正确,但是运行eclipse时提示:Failed to load the JNI shared library " xxx\jva.dll" 原因 ...
随机推荐
- 线性表的顺序存储结构C语言版
#include <stdio.h> #define MAXSIZE 101 #define N 10 typedef struct SeqList { int data[MAXSIZE] ...
- 在Ubuntu 14.04安装Nginx
###介绍 Nginx是世界上最流行的网络服务器中的一种,负责托管网络上一些流量最高的网站.在多数情况下,Nginx比Apache在资源上更加友好,可以作为网络服务器或反向代理服务器. 这篇教程中,我 ...
- [转]java.sql.SQLException: 无效的列索引
原文地址:http://blog.sina.com.cn/s/blog_6bc811e401011a17.html java.sql.SQLException: 无效的列索引 “无效的列索引”其实是个 ...
- 2010-2014总结 ____V_V____ hello-world
.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table ...
- Spring Assert 断言
Assert(断言)的初步理解构思 Web 应用在接受表单提交的数据后都需要对其进行合法性检查,如果表单数据不合法,请求将被驳回.类似的,当我们在编写类的方法时,也常常需要对方法入参进行合 法性检查, ...
- Maven-生命周期
Maven的生命周期是为了对所有的构建过程进行了抽象了,便于统一. clean(清理) 此生命周期旨在给工程做清理工作,它主要包含以下阶段: pre-clean - 执行项目清理前所需要的工作. cl ...
- python面向对象
1.概念 类:(class):具有相同属性和方法的对象的集合.用来定义该集合中每个对象所共有的属性和方法.对象是类的实例. 方法:类中定义的函数. 实例化:创建一个类的实例,类的具体对象. 对象:通过 ...
- Oracle触发器实例(网搜)
触发器使用教程和命名规范 目 录触发器使用教程和命名规范 11,触发器简介 12,触发器示例 23,触发器语法和功能 34,例一:行级触发器之一 45,例二:行级触发器之二 46,例三:INSTEA ...
- 【caffe】基本数据结构blob
@tags: caffe blob blob是caffe中的基本数据结构,简单理解就是一个"4维数组".但是,这个4维数组有什么意义? BTW,TensorFlow这款google ...
- Maven配置不成功
配置了MAVEN_HOME,新建了java文件,在d:/java/MAVEN_HOME/apach....,path下输出%MAVEN_HOME%bin,为什么cmd下mvn不行呢?因为MAVEN_H ...