最佳答案
我读过一些不鼓励使用 DYLD _ LIBRARY _ PATH 的文章,因为动态库的路径应该使用-install _ name、@rpath 和@loader _ path 修复。
In terms of making a program that runs both on Linux and Mac OS X, DYLD_LIBRARY_PATH of Mac OS X does exactly what LD_LIBRARY_PATH of Linux. And, we can share (almost) the same make file that doesn't have the -install_name and @rpath.