PDA

View Full Version : Qt 4.7.2 - Definitely something wrong with macdeployqt



agarny
5th March 2011, 09:56
After installing Qt SDK 1.1 Beta (I am only interested in Qt Creator 2.1.0 and Qt 4.7.2), I have been experiencing some problems with my application. I have now established the cause of the problem: macdeployqt.

Here is a very simple reproducible scenario: Create a new folder; Create a file called Test.pro with the following contents (notice that webkit has been added to the default core and gui components:
QT += core gui webkit

TARGET = Test
TEMPLATE = app

SOURCES += main.cpp Create a file called main.cpp with the following contents:
#include <QApplication>
#include <QWebView>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QWebView w;

w.show();

return a.exec();
} From the terminal, do the following:
$ qmakeEverything is fine here. So, let's build our application:
$ make
g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/Developer/QtSDK/Desktop/Qt/472/gcc/mkspecs/default -I. -I/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtCore.framework/Versions/4/Headers -I/Developer/QtSDK/Desktop/Qt/472/gcc/include/QtCore -I/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Versions/4/Headers -I/Developer/QtSDK/Desktop/Qt/472/gcc/include/QtGui -I/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtWebKit.framework/Versions/4/Headers -I/Developer/QtSDK/Desktop/Qt/472/gcc/include/QtWebKit -I/Developer/QtSDK/Desktop/Qt/472/gcc/include -I. -F/Developer/QtSDK/Desktop/Qt/472/gcc/lib -o main.o main.cpp
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o Test.app/Contents/MacOS/Test main.o -F/Developer/QtSDK/Desktop/Qt/472/gcc/lib -L/Developer/QtSDK/Desktop/Qt/472/gcc/lib -framework QtWebKit -framework QtGui -framework QtCoreThings are still fine, so we can try running our test application:
$ open Test.appAs expected, everything is fine: our test application opens and runs without any problem. So, let's get it ready for deployment by using macdeployqt:
$ macdeployqt Test.app
ERROR: file copy failed from "/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Resources/qt_menu.nib/classes.nib"
ERROR: to "Test.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/classes.nib"
ERROR: file copy failed from "/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Resources/qt_menu.nib/info.nib"
ERROR: to "Test.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/info.nib"
ERROR: file copy failed from "/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib"
ERROR: to "Test.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib"Amazingly enough, despite the above error messages, the reported files have been properly copied! Anyway, let's carry on and try to run our test application:
$ open Test.appUnfortunately, this time round, we get a message box that reads:
Test quit unexpectedly.
Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.
<Ignore> <Report...> <Reopen>This is most frustrating, but now if you remove webkit from our Test.pro file, i.e.
QT += core gui

TARGET = Test
TEMPLATE = app

SOURCES += main.cppand have our main.cpp file to read:
#include <QApplication>
#include <QMainWindow>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QMainWindow w;

w.show();

return a.exec();
}then, macdeployqt still generates the aforementioned error messages, but at least the resulting application still works.

Now, could someone confirm all of the above? If what I am reporting was to be proven correct, then there is definitely something wrong with macdeployqt, and I will see about reporting this to the trolls.

Otherwise, I couldn't help but notice that, as a result of macdeployqt, two sets of QtCore and QtGui binaries are deployed: one under Test.app/Contents/Frameworks/QtXXX.framework/Versions/4 and another under Test.app/Contents/Frameworks/QtXXX.framework/Versions/Current. Other Qt components only have Test.app/Contents/Frameworks/QtXXX.framework/Versions/4, but QtWebKit (i.e. in the failing scenario) has Test.app/Contents/Frameworks/QtXXX.framework/Versions/Current! Gosh, things really seem to be messed up in this version of macdeployqt. :mad:

agarny
5th March 2011, 23:28
I have posted the same message on the Qt Developer Network forum and it would seem that this is a bug. So, I have filed it here (http://bugreports.qt.nokia.com/browse/QTBUG-17959).

agarny
4th May 2011, 20:20
For what it is worth, the problem still hasn’t been fixed in the final release of Qt SDK 1.1. :(

brucewuu
12th July 2011, 08:38
yes , I also meet such problem , and I didn't know why , and tried to find the answers , but still failed . do you guys already find the solutions for this ? If you have , please let me know , thanks very much

hitmaneidos
12th November 2011, 15:58
I am using Qt Creator 2.1.0 and Qt libraries 4.7.4. I can confirm that this problem still exists. Guess I'll have to manually do what macdeployqt does so it doesn't mess up the application.