问题
I'm preparing my application for deployment on OSX. The only problem is relocating the shared libraries.
I put them all inside a Frameworks-folder in the .app-folder itself.
What I try for every library is something like:
install_name_tool \
-id @executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql \
MyProgram.app/Contents/MacOS/MyProgram
install_name_tool \
-change QtSql @executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql \
MyProgram.app/Contents/MacOS/MyProgram
When I run otool -L on my executable again nothing changed.This is still the output:
kqoauth.framework/Versions/0/kqoauth (compatibility version 0.95.0, current version 0.95.0)
QtDeclarative.framework/Versions/4/QtDeclarative (compatibility version 4.7.0, current version 4.7.3)
QtScript.framework/Versions/4/QtScript (compatibility version 4.7.0, current version 4.7.3)
QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
QtSvg.framework/Versions/4/QtSvg (compatibility version 4.7.0, current version 4.7.3)
QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
QtSql.framework/Versions/4/QtSql (compatibility version 4.7.0, current version 4.7.3)
QtXmlPatterns.framework/Versions/4/QtXmlPatterns (compatibility version 4.7.0, current version 4.7.3)
QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.7.0, current version 4.7.3)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
What am I doing wrong?
回答1:
Did you try
install_name_tool \
-change QtSql.framework/Versions/4/QtSql \
@executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql \
MyProgram.app/Contents/MacOS/MyProgram
? You likely need to use the full current install name as shown on otool -L
.
来源:https://stackoverflow.com/questions/6282889/install-name-tool-does-nothing