Unsolved Errors in deploying Mac app using macdeployqt
-
I try to run macdeployqt to deploy my qt application on mac. I got the following error message:
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
ERROR: Unexpected prefix "@loader_path"
File exists, skip copy: "sample.app/Contents/PlugIns/platforms/libqcocoa.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/printsupport/libcocoaprintersupport.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqdds.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqgif.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqicns.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqico.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqjpeg.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqtga.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqtiff.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqwbmp.dylib"
File exists, skip copy: "sample.app/Contents/PlugIns/imageformats/libqwebp.dylib"
WARNING:
WARNING: "sample.app/Contents/Resources/qt.conf" already exists, will not overwrite.
WARNING: To make sure the plugins are loaded from the correct location,
WARNING: please make sure qt.conf contains the following lines:
WARNING: [Paths]
WARNING: Plugins = PlugInsMy Qt version is 5.12.0
Does anyone know how to resolve it? Thanks. -
Hi and welcome to devnet,
Are you getting that the first time you run macdeployqt on your application bundle ?
What does your .pro file look like ? -
Not sure if I'm getting that the first time I run macdeployqt. I have ran it several times, the errors are the same.
Here is my .pro file,
QT += core gui QT += xml greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = sample TEMPLATE = app # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 CONFIG += c++11 SOURCES += \ main.cpp \ mainwindow.cpp \ actionlistdialog.cpp \ customtreewidget.cpp \ filterparameters.cpp \ actionlist.cpp \ actionlistmanager.cpp \ action.cpp \ savexmldialog.cpp HEADERS += \ mainwindow.h \ actionlistdialog.h \ customtreewidget.h \ filterparameters.h \ actionlist.h \ actionlistmanager.h \ action.h \ savexmldialog.h FORMS += \ mainwindow.ui \ actionlistdialog.ui \ savexmldialog.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target
-
The .pro file looks fine.
How did you install Qt ?
-
I downloaded qt-unified-mac-x64-3.0.6-online.dmg file and run the installation.
-
Can you rebuild your project from scratch and run
macdeployqt
with the verbose option on a higher level ? -
It is interesting. When I tried to run from pathToQt/clang_64/bin
./macdeployqt <path to project.app>
everything is working. But when I run from the same location
macdeployqt <path to project.app>
I got the ERROR: Unexpected prefix "@loader_path".
-
It means you are likely not running the
macdeployqt
version you think you are running.What does
which macdeployqt
return ? -
which macdeployqt returns
/anaconda3/bin/macdeployqt -
So it looks like you are not using the correct version of
macdeployqt
. Use the full path to the Qt 5.12 version.