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" 原因 ...
随机推荐
- 开发错误记录1:解决:Only the original thread that created a view hierarchy can touch its views.
今天在项目中要使用圆角头像,导入开源 CircleImageView ,然后setImageBitmap()时 运行时就会发现,它会报一个致命性的异常:: · ERROR/AndroidRuntime ...
- mysql基础语法及拓展到web中的sql注入
本来是想写下javaweb的mvc(tomcat, spring, mysql)的搭建, 昨天搭到凌晨3点, 谁知道jdbcTemplate的jar包不好使, 想死的心都有了, 想想还是休息一下, ...
- win7如何让局域网其他电脑通过IP直接访问自己电脑的网站
一.打开控制面板 二.打开防火墙 三.点击右侧高级设置 四.点击防火墙属性 五.点击防火墙状态选择为关闭,确定 六.点击右侧允许或功能通过windows防火墙 七.执行第六部会打开防火墙通信例外窗口, ...
- linux定时器(crontab)实例
linux实验示例----实现每2分钟将“/etc”下面的文件打包存储到“/usr/lobal”目录下 ·Step1:编辑当前用户的crontab并保存终端输入:>crontab -u root ...
- C++ 合成默认构造函数的真相
对于C++默认构造函数,我曾经有两点误解: 类如果没有定义任何的构造函数,那么编译器(一定会!)将为类定义一个合成的默认构造函数. 合成默认构造函数会初始化类中所有的数据成员. 第一个误解来自于我学习 ...
- C++强制类型转换操作符 dynamic_cast
dynamic_cast是四个强制类型转换操作符中最特殊的一个,它支持运行时识别指针或引用. >>>>>>>>>>>编译器的RTTI设 ...
- Android笔试和面试提点
Android基础知识 Android 的四大组件是哪些? Activity,Service,Broadcast和ContentProvide Android 的常用的容器布局是哪些? FrameLa ...
- bzoj2219: 数论之神
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...
- [NOIP2012] 提高组 洛谷P1084 疫情控制
题目描述 H 国有 n 个城市,这 n 个城市用 n-1 条双向道路相互连通构成一棵树,1 号城市是首都, 也是树中的根节点. H 国的首都爆发了一种危害性极高的传染病.当局为了控制疫情,不让疫情扩散 ...
- Jsoncpp Compiler、Programming
catalog . C++ jsoncpp简介 . Jsoncpp的下载与编译 . Linux Jsoncpp的SDK编译 & 简单实例 . Windows Jsoncpp的SDK编译 &am ...