macdeployqt - Missing dependancies when installing.
-
I created an application which runs in Qt creator.
Using macdeployqt to make an installer; once installed on another Mac, I get the following error trying to execute the application :Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
I really need to deploy this asap.
Thank you.
-
Hi and welcome to devnet,
What version of Qt ?
On what version of macOS ?
What parameters did you pass tomacdeployqt
? -
I am using Qt v5.8 on OS X 10.11.6.
I simply used :
macdeployqt mytest.app -dmg
from the release directory.
Thank you.
-
This post is deleted!
-
Might be a silly question but do you have several version of Qt installed ? If so, which version of macdeployqt are you using ?
-
Can you share your .pro file ?
-
#-------------------------------------------------
Project created by QtCreator 2017-01-30T13:13:14
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = ImagoTN1
TEMPLATE = appDEFINES += QT_DEPRECATED_WARNINGS
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
CONFIG+=static
RESOURCES +=
tn1res.qrcmacx: LIBS += -L$$PWD/lib/ -lfreeimage -lippcc -lippch -lippcore -lippcv -lippdc -lippi -lipps -limfilters
INCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD/includemacx: PRE_TARGETDEPS += $$PWD/lib/libfreeimage.a $$PWD/lib/libippcc.a $$PWD/lib/libippch.a $$PWD/lib/libippcore.a
$$PWD/lib/libippcv.a $$PWD/lib/libippdc.a $$PWD/lib/libippi.a $$PWD/lib/libipps.a
$$PWD/lib/libippvm.a $$PWD/lib/libimfilters.a -
Can you show the result of
otool -L
on your application ?What does the Frameworks folder contain ?
Also, what parameters are you passing to
macdeployqt
? -
i had a similar problem,
in my case the deps were succesfully deployed to the qt but the application still could not find them,
(they should be in myapp.app/Contents/Frameworks)if your issue is similar, you could try
compiling with this flag, which will create an rpath to the frameworks folderQMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
or to fix current version without recompile you could try editing current rpath
install_name_tool -add_rpath "@executable_path/../Frameworks" myapp.app/Contents/MacOS/myapp
-
@chips-and-fish Thank you so much ! That fixed it.
Although I am a bit surprised as the path to Framework is an artifact of macdeployqt; one would think it would automatically add it...