install_name_tool什么都不做

时间:2011-06-08 17:37:01

标签: macos deployment install-name-tool

我正准备在OSX上部署我的应用程序。 唯一的问题是重新定位共享库。

我将它们全部放在.app文件夹本身的Frameworks文件夹中。

我为每个图书馆尝试的是:

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

当我再次在我的可执行文件上运行otool -L时没有任何改变。这仍然是输出:

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)

我做错了什么?

1 个答案:

答案 0 :(得分:3)

你试过吗

install_name_tool \
    -change QtSql.framework/Versions/4/QtSql \
    @executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql \
    MyProgram.app/Contents/MacOS/MyProgram

?您可能需要使用otool -L上显示的完整当前安装名称。