我正在尝试将可执行文件放在一起发送到另一台计算机。otool -L "exec_name" 返回:
/usr/local/opt/glfw/lib/libglfw.3.dylib (compatibility version 3.0.0, current version 3.3.0)
试图将其更改为我的可执行目录:
install_name_tool -id @executable_path/libglfw.3.3.dylib libglfw.3.3.dylib
它发出警告:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: libglfw.3.3.dylib (for architecture x86_64)
但没有任何变化, otool -L 仍然显示:
/usr/local/opt/glfw/lib/libglfw.3.dylib (compatibility version 3.0.0, current version 3.3.0)
我也试过
install_name_tool -id @executable_path/libglfw.3.3.dylib libglfw.3.dylib
这给出了一个错误:
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: libglfw.3.dylib (No such file or directory)
无法理解为什么它不会改变路径......