我正在Mac上構建使用Qt5.1.1的應用程序。我正在使用包來創建安裝程序。我已經設置好安裝程序,以便將.app文件和所有庫安裝到/ Applications /中的文件夾中。問題是,當我安裝應用程序時,它並未尋找我想要查找庫的位置。Mac OS X如何更改應用程序查找庫的位置
的otool -L表明這一點:
esu:
libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/ken/Qt5.1.1/5.1.1/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.1.0, current version 5.1.1)
/Users/ken/Qt5.1.1/5.1.1/clang_64/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.1.0, current version 5.1.1)
/Users/ken/Qt5.1.1/5.1.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.1.0, current version 5.1.1)
/Users/ken/Qt5.1.1/5.1.1/clang_64/lib/QtSerialPort.framework/Versions/5/QtSerialPort (compatibility version 5.1.0, current version 5.1.1)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.1.0)
/Users/ken/Qt5.1.1/5.1.1/clang_64/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.1.0, current version 5.1.1)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
我如何可以更改應用程序尋找這些庫?
所以install_name_tool命令可能看起來像:install_name_tool -change /Users/ken/Qt5.1.1/5.1.1/clang_64/lib/QtWidgets.framework/版本/ 5/QtWidgets ../../../QtWidgets? –
@JaredPrice我忘了目標,你的'../../../ QtWidgets'取決於你在哪裏輸入命令行...... –
啊,好的。是的,這看起來會起作用。謝謝! –