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

  • 相关阅读:
    学习Java的Day02
    学习Java的Day01
    多线程的了解
    几个MQ的区别
    HTML5——存储(cookie、localStorage、sessionStorage)的区别
    dubbo mock配置
    Springboot分布式,excel导出,运用POI导出,前端用的jsp
    oracle 添加字段和添加注释
    可以重复的Map:IdentityHashMap
    数组转list问题
  • 原文地址:https://www.cnblogs.com/lilei9110/p/4154974.html
Copyright © 2011-2022 走看看