Originally Posted by
gedrite
.....
After using otool on my plugin, I've decided that my problem likely has to do with having wrong paths and id's in my plugin for the Qt Creator app bundle, and therefore I need to use otool and install_name_tool to patch things up to work right.
.....
Progress.
I did get the Qwt designer plugin appearing in Qt Creator. There are instructions on this in the Qt Creator help online, but here is a summary of what I did....
Installed Qt SDK.
Built Qwt 6.0.1
Copied libqwt_designer_pligin.dylib from my qwt build into directory Qt Creator.app/Content/Plugins/designer
Copied qwt.framework and qwtmathml.framework from my Qwt build into Qt Creator.app/Content/Frameworks
Now, in my particular case, I had Qt 4.7.4 installed in /usr/local for some reason and built my Qwt against it. Therefore, running otool on my libqwt_designer_plugin.dylib showed paths for my Qt libraries as /usr/local/Trolltech/Qt-4.7.4/lib/....
You may have your libraries installed somewhere else, so you need to run otool on your plugin to get the path locations it is referring to, and substitute them in for my path below. To run otool, cd to the directory containing your plugin. Then issue "otool -L libqwt_designer_plugin.dylib". My command and output was this:
gedrite 38> otool -L libqwt_designer_plugin.dylib
libqwt_designer_plugin.dylib:
libqwt_designer_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.1)
/usr/local/Trolltech/Qt-4.7.4/lib/QtScript.framework/Versions/4/QtScript (compatibility version 4.7.0, current version 4.7.4)
/usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.4)
/usr/local/Trolltech/Qt-4.7.4/lib/QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.4)
/usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.4)
/usr/local/Trolltech/Qt-4.7.4/lib/QtDesigner.framework/Versions/4/QtDesigner (compatibility version 4.7.0, current version 4.7.4)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1094.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
Ok, I think this is the exact procedure I used (I've pieced it together after I got everything working).
I issue the next 6 commands to patch up the paths, relative to the executable path:
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtScript.framework/Versions/4/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtDesigner.framework/Versions/4/QtDesigner @executable_path/../Frameworks/QtDesigner.framework/Versions/4/QtDesigner libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtScript.framework/Versions/4/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui libqwt_designer_plugin.dylib
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtDesigner.framework/Versions/4/QtDesigner @executable_path/../Frameworks/QtDesigner.framework/Versions/4/QtDesigner libqwt_designer_plugin.dylib
To copy to clipboard, switch view to plain text mode
Now, I need to patch up my qwt lib in Qt Creator.app/Contents/Frameworks/qwt.framework/Versions/6/ So, in Terminal cd to that location.
Running otool on qwt gives me this:
gedrite 58> otool -L qwt
qwt:
qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.1)
/usr/local/Trolltech/Qt-4.7.4/lib/QtSvg.framework/Versions/4/QtSvg (compatibility version 4.7.0, current version 4.7.4)
/usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.4)
/usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.4)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1094.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
To patch it up, I issued these commands:
sudo install_name_tool -id @executable_path/../Frameworks/qwt.framework/Versions/6/qwt qwt
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtSvg.framework/Versions/4/QtSvg @executable_path/../Frameworks/QtSvg.framework/Versions/4/QtSvg qwt
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui qwt
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore qwt
sudo install_name_tool -id @executable_path/../Frameworks/qwt.framework/Versions/6/qwt qwt
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtSvg.framework/Versions/4/QtSvg @executable_path/../Frameworks/QtSvg.framework/Versions/4/QtSvg qwt
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui qwt
sudo install_name_tool -change /usr/local/Trolltech/Qt-4.7.4/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore qwt
To copy to clipboard, switch view to plain text mode
Regarding qwtmathml.framework, I am guessing you use the same procedure as you used for qwt, substituting the relevant dependencies of course.
Now I have Qwt appearring in my Designer plugin in Qt Creator. I have not built any apps yet, so no idea if I got it all right.
Bookmarks