Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Mac deployment not very easy but maybe a solution

Mac deployment not very easy but maybe a solution

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    muuiwndii
    wrote on last edited by
    #1

    Hi,
    I've got a problem with deploying my Qt/c++ app on macos but maybe i solved it... don't really know as i don't have a clean mac os to test.
    My app works well with Qt creator.
    Here's what i did :
    i ran macdeployqt on the .app folder created by QTCreator
    This tool claimed that /Users/(...)/clang_64/Frameworks/(...)/QtWidgets was missing
    and i had the same msg for all essential Qt libs.
    after a little find command i found at that my files were in /Users/(...)/clang_64/Lib/(...)/QtWidgets
    and that i had no "Frameworks" directory in /Users/(...)/clang_64.
    So i made a "ln -s /Users/(...)/clang_64/Lib /Users/(...)/clang_64/Frameworks
    seems it did the trick as rerunin macdeployqt on a fresh created .app folder was apparently working (no error message).
    But now then i tried to run my app directly from the finder it does nothing and by launching it in the terminal i get an error message claiming that "This application failed to start cause it can't find or load the Qt platform plugin cocoa"
    i added a platforms directory in the Content folder of my .app folder and copied libcocoa.dylib in it
    Now i'm able to launch the binary directly from terminal; but i'm wondering if it will run on another mac...

    1 Reply Last reply
    0
    • M Offline
      M Offline
      muuiwndii
      wrote on last edited by
      #2

      just to clarrify as now i'm able to create a working dmg file (i still don't know how it will act on a non developer mac...)
      here are the steps i followed

      • Build release with QtCreator

      • ln -s /Users/(….)/clang_64/Lib /Users/(…)/clang_64/Frameworks (do that only once it's permanent)

      • create a "platforms" folder in yourApplication.app/Content/MacOS directory and put libqcocoa.dylib (found in <QtDir>/clang_64/platforms) in it.

      • macdeployqt yourApplication.app -dmg

      And you have a portable (i hope) dmg file
      i'll let u know as soon as i try on a nude OS

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #3

        Hi, you can test by moving your Qt installation somewhere else temporarily, or just rename the Qt directory. Then try to run your app from the finder.

        It's a cheap way of simulating running on another Mac :-)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          muuiwndii
          wrote on last edited by
          #4

          oh really ? Cool ! That's the sandbox effect i guess, u're right. as the app should not try to search for system lib right ?
          I tried to copy my dmg file anywhere and still working :)))
          so i guess it's ok. Just gotta learn to create a deb and a rpm and my project will run almost everywhere (as i already created the windows installer with innosetup)
          That's a lot of work for deployment.. I'm really wondering if i should not use Qt Installer framework.. On the other hand linux and mac users would prefer a native installer... cruel dilemma

          IN CASE SOMEONE READS THIS :

          in fact, 'spite the dmg format the binary file in it was referencing /Users/[MyUsername]/Qt/5.2/clang_64/....Qtwidgets and every other lib so moving dmg file on disk is not a good solution. I found out by trying to install on a fresh copy of mac OS (which is finally really simple to obtain I intialy dual booting macOS with another macos would be hard but it's very easy ^^)
          whatever seems i have to use a tool named install_tool_name find out that in the doc ^^.
          should have start from there i guess but experimenting is always fun and a more effective to learn deeply :p

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved