3

I've installed the latest version of Qt (5.1) and when I try to deploy my app on Mac using the macdeployqt tool, the app is still not working on other macs. It's completely working on my Mac and it doesn't not indicate any errors. After researches I found this and I think it's my problem : Qt 5.1 and Mac: Bug making macdeployqt not working properly and https://bugreports.qt-project.org/browse/QTBUG-14699 But the explanation is too technical for me (+ english not my native language), I'm a complete beginner, can you explain what do I have to do to simply make my app work on Mac ? Step by step ? It is perfectly functional on Windows (with the standard dlls).

Thank you so much, I think it will help a lot of beginners that are going through the same issue.

Community
  • 1
  • 1
Pomologue
  • 33
  • 1
  • 4
  • You are giving the answer yourself. read your first link section ``UPDATE, HOW TO DEPLOY:`` and follow it. Generally: 1. Fix the double slashes. 2. Compile your own macdeployqt. 3. call macdeployqt with qml directory given. – Sebastian Lange Jul 31 '13 at 05:08

1 Answers1

3

There are 3 tools at your disposal to sort out deployment of Qt for OS X (MacOS).

  1. macdeployqt: This tool gathers all the Qt libraries that your application declares it needs in its project, adds them to the app bundle and updates their paths so that your application knows where to find them.

  2. otool: A complex tool for examining the contents of binaries, but in this case, used with the -L argument, will display the paths to all the libraries that your application will reference. These are the paths that it will be looking to find those libraries.

  3. install_name_tool: Since macdeployqt only handles Qt libraries that are required by your application, you can use install_name_tool to update paths to any other libraries that your app requires. For example, if you have a separate non-Qt framework that your application relies upon, you need to have a post compilation step to copy the framework into the application bundle and then use install_name_tool to update the paths to the framework.

If you're having problems, check that the libraries / frameworks have been copied to the correct location in the application bundle and then use otool -L to check the paths. If any are incorrect, use name_install tool to fix them.

If you still can't get it to work, please edit your question and add the output from using otool -L.

Note, historically, various versions of Qt have suffered bugs with the macdeployqt utility, so if it is not working properly, you may also want to check the qt bug tracker.

tresf
  • 7,103
  • 6
  • 40
  • 101
TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85
  • Thank you for your answer but I've tried and it's not working still... I will just make the windows app available because it's getting on my nerves, it shouldn't be more complicated than using the macdeployqt tool – Pomologue Aug 01 '13 at 07:31
  • It's not difficult, once you understand what's going on. Post the output from running otool -L on the executable. For example: otool -L /Applications/Calculator/Contents/MacOS/Calculator – TheDarkKnight Aug 01 '13 at 07:58
  • Hello, a big thank you for sticking around and wanting to help, it's really cool and kind. I sent the app to a lot of friends with Macs and finally I noticed that only the ones running Mavericks (10.9) are having issues. A Google search later I see that Qt is simply not supporting Mavericks yet. It was so simple. – Pomologue Aug 01 '13 at 21:21
  • No problem and thanks for the update. I guess I'll need to test my own code on Mavericks in the near future, but I would think of it more as Mavericks not supporting Qt, as the OS is still a beta, so nothing is guaranteed there. – TheDarkKnight Aug 02 '13 at 07:41