linking qwt problem - mac os
-
When building my main app, my application links to qwt
I need qwt and would like it to be linked correctly like other Qt frameworks.
I rebuilded qwt 6.1.3 with 5.8.0, put the resulting .framework in /Library/Frameworks and also in qtInstallFolder/libHere is the part linking qwt in my .pro
QMAKE_LFLAGS += -F/Users/tourlou3/Dropbox/qwt-6.1.3/lib LIBS += -framework qwt INCLUDEPATH += /Users/tourlou3/Dropbox/qwt-6.1.3/src
Every time I rebuild, I have to change my executable with install_name_tool before deploying, since the path of the qwt link is wrong
Here are the libs linked to my app using otool -L
tourlou3s-Mac:~ tourlou3$ otool -L /Users/tourlou3/build-PowerVelo2-Desktop_Qt_5_8_0_clang_64bit-Release/MaximumTrainer.app/Contents/MacOS/MaximumTrainer /Users/tourlou3/build-PowerVelo2-Desktop_Qt_5_8_0_clang_64bit-Release/MaximumTrainer.app/Contents/MacOS/MaximumTrainer: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0) @rpath/VLCQtCore.framework/Versions/1.1.0/VLCQtCore (compatibility version 1.1.0, current version 1.1.0) @rpath/VLCQtWidgets.framework/Versions/1.1.0/VLCQtWidgets (compatibility version 1.1.0, current version 1.1.0) @rpath/libsfml-audio.2.3.dylib (compatibility version 2.3.0, current version 2.3.0) qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.3) @rpath/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.8.0, current version 5.8.0) @rpath/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.8.0, current version 5.8.0) @rpath/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0) @rpath/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0) @rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0) @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0) /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0) @rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0) @rpath/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.8.0, current version 5.8.0) @rpath/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.8.0, current version 5.8.0) @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.8.0, current version 5.8.0) @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0) @rpath/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.8.0, current version 5.8.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
Also note that I am having this error while using macdeployqt:
ERROR: no file at "/Library/Frameworks/qwt.framework/Versions/6/qwt.framework/Versions/6/qwt"There is indeed my library located in /Library/Frameworks/ so I don't understand why it fails there.
So after each build, I have to manually copy the library "qwt.framework" inside my Content/Frameworks and run install_name_tool
install_name_tool -change qwt.framework/Versions/6/qwt @executable_path/../Frameworks/qwt.framework/Versions/6/qwt /Users/tourlou3/build-PowerVelo2-Desktop_Qt_5_8_0_clang_64bit-Release/MaximumTrainer.app/Contents/MacOS/MaximumTrainerAnyone ran into this problem? Cheers,
Max -
@maximus said in linking qwt problem - mac os:
/Library/Frameworks/qwt.framework
Can you post the output of
find /Library/Frameworks/qwt.framework
and as for the library it may resolve with the macqtdeploy starting to work, otherwise you may need to run otool on your libs themselves setting it to use a relative rpath, then it will work even on a raw copy without otool intervention.Most of my deploys for my commercial apps on OSX I end up with quite large bash shell scripts that run the otool stuff I need on the dependency libs.
I find it's easier than constantly fighting macdeployqt and it assures me that my application will definitely be deploy ready instead of relying a tool that has failed me many times in the past.
-
The weird think in the macdeployqt error is this part
ERROR: no file at "/Library/Frameworks/qwt.framework/Versions/6/qwt.framework/Versions/6/qwt"
The library is in /Library/Frameworks/qwt.framework/Versions/6/qwt"It seems like some kind of recursive dependency, qwt.framework inside qwt.framwork?
5.8.0 seems to have fixed most of the bug that I had with macdeployqt from 5.5 to 5.7.1.
Usually I am fine deploying with it without too much hassle.I ran your find and found this
tourlou3s-Mac:~ tourlou3$ find /Library/Frameworks/qwt.framework
/Library/Frameworks/qwt.framework
/Library/Frameworks/qwt.framework/.DS_Store
/Library/Frameworks/qwt.framework/Headers
/Library/Frameworks/qwt.framework/qwt
/Library/Frameworks/qwt.framework/Resources
/Library/Frameworks/qwt.framework/Versions
/Library/Frameworks/qwt.framework/Versions/.DS_Store
/Library/Frameworks/qwt.framework/Versions/6
/Library/Frameworks/qwt.framework/Versions/6/Headers
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_abstract_legend.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_abstract_scale.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_abstract_scale_draw.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_abstract_slider.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_analog_clock.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_arrow_button.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_clipper.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_color_map.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_column_symbol.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_compass.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_compass_rose.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_compat.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_counter.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_curve_fitter.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_date.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_date_scale_draw.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_date_scale_engine.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_dial.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_dial_needle.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_dyngrid_layout.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_event_pattern.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_global.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_graphic.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_interval.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_interval_symbol.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_knob.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_legend.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_legend_data.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_legend_label.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_magnifier.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_math.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_matrix_raster_data.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_null_paintdevice.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_painter.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_painter_command.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_panner.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_picker.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_picker_machine.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_pixel_matrix.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_abstract_barchart.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_barchart.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_canvas.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_curve.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_dict.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_directpainter.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_glcanvas.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_grid.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_histogram.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_intervalcurve.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_item.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_layout.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_legenditem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_magnifier.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_marker.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_multi_barchart.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_panner.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_picker.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_rasteritem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_renderer.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_rescaler.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_scaleitem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_seriesitem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_shapeitem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_spectrocurve.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_spectrogram.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_svgitem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_textlabel.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_tradingcurve.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_zoneitem.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_plot_zoomer.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_point_3d.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_point_data.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_point_mapper.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_point_polar.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_raster_data.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_round_scale_draw.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_samples.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_sampling_thread.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_scale_div.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_scale_draw.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_scale_engine.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_scale_map.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_scale_widget.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_series_data.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_series_store.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_slider.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_spline.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_symbol.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_system_clock.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_text.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_text_engine.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_text_label.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_thermo.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_transform.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_wheel.h
/Library/Frameworks/qwt.framework/Versions/6/Headers/qwt_widget_overlay.h
/Library/Frameworks/qwt.framework/Versions/6/qwt
/Library/Frameworks/qwt.framework/Versions/6/Resources
/Library/Frameworks/qwt.framework/Versions/6/Resources/Info.plist
/Library/Frameworks/qwt.framework/Versions/Current -
@maximus Yea it looks like the macdeployqt tool was, for lack of a better term, greping your otool output incorrectly so it formed the wrong path for that qwt framework. Including the qwt.framework/* section twice.
Good to know that 5.8 fixed the problem though. It may have just been a bug in the earlier macqtdeploy. Those are the bugs I've come to expect from the macqtdeploy app and the reason I stopped using it for the most part. :)
-
Yeah I guess macdeployqt generate a wrong path like you said, just don't know why it happens only for this framework in particular..
I always struggle deploying on mac, wish there was an easy way to deploy and speed up packaging for new releases.
For now I will use macdeployqt + a few command line to fix this bug.
Thanks for the help
Max -
I give up on qwt.
I tried editing the framework path to permanently fix it but was not successful.
install_name_tool doesn't change it to @rpath/.. for some reason.tourlou3s-Mac:qwt.framework tourlou3$ otool -L qwt
qwt:
qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.3)
@rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.8.0, current version 5.8.0)
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@rpath/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.8.0, current version 5.8.0)
@rpath/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.8.0, current version 5.8.0)
@rpath/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.8.0, current version 5.8.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)tourlou3s-Mac:qwt.framework tourlou3$ install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt /Users/tourlou3/Qt5.8.0/5.8/clang_64/lib/qwt.framework/Versions/Current/qwt
-
@maximus said in linking qwt problem - mac os:
Yeah I guess macdeployqt generate a wrong path like you said, just don't know why it happens only for this framework in particular..
I always struggle deploying on mac, wish there was an easy way to deploy and speed up packaging for new releases.
For now I will use macdeployqt + a few command line to fix this bug.
Thanks for the help
MaxLol yea that is what I do.. In the end I even dropped using macdeployqt entirely.
I thought about writing an open source project that helps easily deploy on osx but I just haven't had the time to do it. Deploying on OSX has so many things that it needs that even writing an automated app is daunting.
I mean essentially that is what macdeployqt is, and well, you see that doesn't always work. ;)
-
@maximus Have you done the -id part of the otool?
otool -id @executable_path/Frameworks/qwt.framework/Versions/6/qwt Frameworks/qwt.framework/Versions/6/qwt
Then:
otool -change /Library/Frameworks/qwt.framework/Versions/6/qwt @executable_path/Frameworks/qwt.framework/Versions/6/qwt /path/to/your/binary
This is for your actual binary though, not to fix it permanently. This would be run before deploy each time.
-
Yes it is working for my app binary.
I tried changing the qwt reference to itself and adding "@rpath/.." so I don't have to do this over and over again.
Will try that on the qwt library tonight, forgot the -id part, probably why it was not changing.I would be happy to get a tool that just change the path of ALL my depending libs to @rpath/[name_of_lib]
in my Qt .pro file, I already set my @rpath to the locations relative to the executable I want to look at runtime.