How to use dylib in Mac OS X (C++)

前端 未结 4 624
日久生厌
日久生厌 2020-11-30 22:49

I made an application (an executable) calling some dylib successfully, However, the dylib files and the executable are in different directory. I added the directory contains

4条回答
  •  悲&欢浪女
    2020-11-30 23:43

    If the dylib is in the place specified by the INSTALL_NAME of the library, it will Just Work*.

    Otherwise, you can add the location of the dylib to DYLD_LIBRARY_PATH. You might want to read the dyld documentation.

    *) to be totally precise, it needs to be at DYLD_ROOT_PATH/INSTALL_NAME, but fussing with DYLD_ROOT_PATH is pretty rare.

提交回复
热议问题