Confusing "Library not loaded" error on macOS.
-
Hello.
I'm trying to build and run a Qt project on macOS.
The project was originally written for Linux, and it works on Linux with Qt5.
I've been able to get the project to build on macOS with Qt6, but when I try to run the executable I see a 'Library not loaded' error, which either says
dyld: Library not loaded: @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport Referenced from: /Users/davidspry/Documents/Qt/6.0.3/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets Reason: image not found
or
dyld: Library not loaded: @rpath/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets Referenced from: /Users/davidspry/Documents/Qt/6.0.3/clang_64/lib/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets Reason: image not found
However, I don't believe that the project uses the 'Multimedia Widgets' module. Here is the
.pro
file:greaterThan(QT_MAJOR_VERSION, 4): QT += widgets QT += core gui QT += webkit QT += webkitwidgets QT += printsupport QT += network QT += gui TARGET = hiped CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp \ keylist.cpp \ connection.cpp \ connectionmanager.cpp \ container.cpp \ containerframe.cpp \ containertoplevel.cpp \ hipe_instruction.c \ common.c \ sanitation.cpp \ instructionhandler.cpp HEADERS += main.hpp \ ExpArray.hh \ keylist.h \ common.h \ connection.h \ connectionmanager.h \ container.h \ containerframe.h \ containertoplevel.h \ hipe_instruction.h \ sanitation.h \ instructionhandler.h QMAKE_CXXFLAGS += -std=c++17 -O3 -pthread LIBS += -pthread
Can anyone suggest a way for me to get this working?
Thank you.
-
@davidspry said in Confusing "Library not loaded" error on macOS.:
I don't believe that the project uses the 'Multimedia Widgets' module
From the error message you can see that QtWebKitWidgets needs it.
Do you start your project from QtCreator or manually from Finder/terminal?
-
Ok, I see. If QtWebKitWidgets depends on QtMultimediaWidgets, then my version of Qt (6.0.3) may be the issue. As I understand it, Qt 6.0 doesn't include QtMultimedia. I'll install Qt5 and see how that goes.
As for starting the project, I've tried building from Terminal and from QtCreator. In both cases the project builds successfully but crashes when it's run.
-
@davidspry said in Confusing "Library not loaded" error on macOS.:
Qt 6.0 doesn't include QtMultimedia
This is correct