我在macOS中有一个cpp游戏客户端:
$ otool -L ./XXXGameClient
./XXXGameClient:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
@rpath/SDL2.framework/Versions/A/SDL2 (compatibility version 1.0.0, current version 8.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
@rpath/SDL2_image.framework/Versions/A/SDL2_image (compatibility version 1.0.0, current version 3.1.0)
@rpath/SDL2_mixer.framework/Versions/A/SDL2_mixer (compatibility version 1.0.0, current version 1.1.0)
@rpath/SDL2_ttf.framework/Versions/A/SDL2_ttf (compatibility version 15.0.0, current version 15.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 52.0.0, current version 52.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
@rpath/libclang_rt.asan_osx_dynamic.dylib (compatibility version 0.0.0, current version 0.0.0)
游戏客户端具有完整路径的libpng依赖项,我想将libpng
二进制文件分发到可执行目录,并且它正确加载lib,就像SDL2使用RPATH功能一样。
我该怎么办?