Qt.nib Questions on MacOS

I am trying to deploy a Qt C ++ application on another Mac that does not have Qt. I get an internal Qt error: qt_menu.nib could not be loaded. The .nib file should be placed in QtGui.framework / Versions / Current / Resources / or in the resource directory of your application package.

I tried packing qt_menu.lib in both suggested places, without success:

$ ls ./arya.app/Resources/ qt_menu.nib $ ./arya.app/Contents/MacOS/arya Qt internal error: qt_menu.nib could not be loaded. The .nib file should be placed in QtGui.framework/Versions/Current/Resources/ or in the resources directory of your application bundle. 

or

 $ mkdir QtGui.framework $ mkdir QtGui.framework/Versions/ $ mkdir QtGui.framework/Versions/Current/ $ mkdir QtGui.framework/Versions/Current/Resources $ mv ./arya.app/Resources/qt_menu.nib QtGui.framework/Versions/Current/Resources/ $ ./arya.app/Contents/MacOS/arya Qt internal error: qt_menu.nib could not be loaded. The .nib file should be placed in QtGui.framework/Versions/Current/Resources/ or in the resources directory of your application bundle. 

I'm not sure if there could be any connection, but before that I had problems with dylib paths. After stumbling with install_name_tool, I "solved" them with:

 export DYLD_LIBRARY_PATH=. 

before running the application.

Create an application using

 CONFIG -= app_bundle 

irrelevant.

+4
source share
3 answers

After dealing with the same problem from another application, I was able to install the exact commands that can easily solve this .nib problem:

 mkdir -p application.app/Contents/Frameworks/QtGui.framework/Resources cp -r $(QTLIBDIR)/QtGui.framework/Versions/4/Resources/qt_menu.nib application.app/Contents/Frameworks/QtGui.framework/Resources 

This does not apply to other deployment problems for mac - just a .nib problem.

+2
source

Try the following:

(1) Remove export DYLD_LIBRARY_PATH=.

(2) Remove CONFIG -= app_bundle

(3) Put the QT frames in. /arya.app/Contents/Frameworks

those. QtGui.framework's entire content. /arya.app/Contents/Frameworks/QtGui.framework, QtCore.framework in. /arya.app/Contents/Frameworks/QtCore.framework etc.

So your qt_menu.nib will automatically be. / Arya.app / Contents / Frameworks / QtGui.framework / Versions / Current / Resources / qt_menu.nib

+1
source

Try running macdeployqt on your .app after creating it. It copies the necessary Qt frames (and any other necessary dylibs ) into the package and commits the binary link paths, so it knows how to associate Qt with its own package.

(This also has an error that causes any libraries with paths not ending in lib/ (for example, /opt/local/lib/opencv/cv.lib so as not to be copied correctly, but there is a one-line source fix for this)

+1
source

Source: https://habr.com/ru/post/1398179/


All Articles