开发者

install_name_tool does nothing

开发者 https://www.devze.com 2023-03-11 18:21 出处:网络
I\'m preparing my application for deployment on OSX. The only problem is relocating the shared libraries.

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号