Important: Please read the Qt Code of Conduct -

Qt 4.7.2 - Definitely something wrong with macdeployqt! :(

  • 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 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;;
    return a.exec&#40;&#41;;


    • From the terminal, do the following:
      @$ qmake@Everything 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 main.o -F/Developer/QtSDK/Desktop/Qt/472/gcc/lib -L/Developer/QtSDK/Desktop/Qt/472/gcc/lib -framework QtWebKit -framework QtGui -framework QtCore@Things are still fine, so we can try running our test application:
      @$ open 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
      ERROR: file copy failed from "/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Resources/qt_menu.nib/classes.nib"
      ERROR: to ""
      ERROR: file copy failed from "/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Resources/qt_menu.nib/info.nib"
      ERROR: to ""
      ERROR: file copy failed from "/Developer/QtSDK/Desktop/Qt/472/gcc/lib/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib"
      ERROR: to ""@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, 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 file, i.e.
      @QT += core gui

    TARGET = Test
    TEMPLATE = app

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

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

    QMainWindow w;;
    return a.exec&#40;&#41;;

    }@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 and another under Other Qt components only have, but QtWebKit (i.e. in the failing scenario) has! Gosh, things really seem to be messed up in this version of macdeployqt.

  • You'd better open an issue on the "bug tracker": to make the guys in charge of macdeployqt aware of the problem. They might not read Qt DevNet at all. And be sure to post the issue id here, so that others can track/vote for the issue.

  • Volker, I am taking it that you tried (assuming you have a Mac) and that you got the same problem? Anyway, I have created a bug tracker:

  • Nope. Although I develop for OS X too, I do not use macdeployqt. It appeared too late - we have our own set of scripts to do the same task (and some more additional work).

  • Because of that macdeployqt issue, I was thinking of reverting to Qt SDK 2010.05, but I like the updated Qt Creator, so I might have a look at doing the work of macdeployqt using my CMake script. Incidentally, Qt SDK 1.1 Beta doesn't seem to work nicely with CMake on Mac OS X, since the installer suggests installing the Qt SDK under one's home directory (!!) which makes CMake unable to find Qt. So far, I must confess that I am rather disappointed by Qt SDK 1.1 Beta. More problems than anything at this point.

  • You can always get the components of the SDK individually. That's what I do, but it is of course a matter of taste (and of habit, as there was no SDK when I started with Qt etc.)

    EDIT: PS - the SDK 1.1 is still in beta test, so some problems should be expected. Unfortunately, it hit you...

  • Unless I am mistaken, Qt SDK 1.1 is indeed beta, but it comes with Qt Creator 2.1.0 and Qt 4.7.2, both of which are not beta. At least, that's what I remember reading somewhere when it came out earlier this week.

  • That's right, but there can be packaging or other errors in the SDK too. It's not just only putting a few binary packages to one big meta package.

    You might be more successful if you use the individual components.

  • Fair point. Ok, I guess I will try to use the individual components and see how things go. It's just that it would be a pain if I have to go that route, since I develop on Windows, Ubuntu (on 3 different virtual machines) and Mac OS X. But well...

  • Ok, I have just uninstalled Qt SDK 1.1 Beta from my Mac and installed Qt 4.7.2 and Qt Creator 2.1.0 individually, and... everything works fine! Ok, that was painless, so I am very happy with this solution (thanks Volker for 'forcing' me into doing it!).

  • For what it is worth, the problem still hasn't been fixed in the final release of Qt SDK 1.1. :(

  • Sorry we as the SDK team didn't got these bugreports - so this is a communication problem. But as an advice if you see something which is working with the standalone Qt but not in the SDK please choose "Nokia Qt SDK Installer" as the project in jira.

    PS: moved the bugreports to us

  • for what its worth:

    • macdeployqt disregards the symbolic links under the frameworks when it is copying them. therefore copying every framework binary twice and crashing at runtime
    • macdeployqt also fails to make a .dmg from applications which contain spaces. this is because it forks hdiutil and hands it the name splitted by ' '.

    i submitted a patch for both problems under

    hope this helps.

Log in to reply