2

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

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

我对每个图书馆的尝试都是这样的:

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)

我究竟做错了什么?

4

1 回答 1

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.

于 2011-06-08T21:30:42.890 回答