zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    bzoj1453
    276D
    855E
    bzoj1458
    树莓派 自启动连接阿里云物联网平台(一)
    树莓派 实现脚本程序自启动
    树莓派4B 系统镜像安装与boot配置
    2019-2020-2《网络对抗技术》 Exp1 PC平台逆向破解
    2019-2020-2 《网络对抗技术》 Exp0 kali 安装
    kali 添加使用 KDE 桌面环境
  • 原文地址:https://www.cnblogs.com/lilei9110/p/4154974.html
Copyright © 2011-2022 走看看