install_name_tool does nothing

匿名 (未验证) 提交于 2019-12-03 07:50:05

问题:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!