Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Deploy QT app on Mac OSX
Forum Updated to NodeBB v4.3 + New Features

Deploy QT app on Mac OSX

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 2.6k 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.
  • A Offline
    A Offline
    Arqam
    wrote on last edited by Arqam
    #1

    I have a QT project which uses openCV as an external library.
    I build openCV in Qt project using the following guidelines : https://www.learnopencv.com/configuring-qt-for-opencv-on-osx/

    Now, I have to create .dmg for my Qt app, and have to release the app. I went through the documentation for deployment but could not understand properly how to build for the release mode.

    Especially when the documentation is for Qt 4.8 and the example project that is being talked about is not there in my new version of Qt.

    I am new to Qt, and thus facing some newbie problems. Basically, I want to understand :

    • How to actually build the app to get the .dmg file in release mode.

    Link for my .pro file : https://justpaste.it/1ae3b

    I tried looking on Internet but could not find anything recent for Mac OSX Qt deployment.

    Running otool -L XMLGenerator.app/Contents/MacOS/XMLGenerator gives :

    XMLGenerator.app/Contents/MacOS/XMLGenerator:
    	@rpath/libopencv_shape.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_stitching.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_objdetect.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_superres.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_videostab.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_calib3d.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_features2d.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_highgui.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_videoio.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_imgcodecs.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_video.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_photo.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_ml.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_imgproc.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_flann.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/libopencv_core.3.2.dylib (compatibility version 3.2.0, current version 3.2.0)
    	@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.9.0, current version 5.9.1)
    	@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.9.0, current version 5.9.1)
    	@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.9.0, current version 5.9.1)
    	/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    	@rpath/QtXml.framework/Versions/5/QtXml (compatibility version 5.9.0, current version 5.9.1)
    	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    	/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
    

    After this I did : macdeployqt yourappname.app -dmg
    And I got the dmg file but the app is crashing.
    Also, all this is in the debug folder and not release folder.

    Now my local project is also not running and am getting the message that :
    This application failed to start because it could not find or load the Qt platform plugin cocoa in Available platform plugins are: cocoa.
    Reinstalling the application may fix this problem. The program has unexpectedly finished.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean the documentation is for Qt 4.8 ?

      • You link to the release version of the dependencies
      • You build it in release mode

      The documentation for releasing for macOS is here and more precisely the part about macdepoyqt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

        What do you mean the documentation is for Qt 4.8 ?

        • You link to the release version of the dependencies
        • You build it in release mode

        The documentation for releasing for macOS is here and more precisely the part about macdepoyqt.

        A Offline
        A Offline
        Arqam
        wrote on last edited by
        #3

        @SGaist said in Deploy QT app on Mac OSX:

        here

        So the way I linked openCV do I need to change anything to get it in the release version?
        OpenCV to QT ->https://www.learnopencv.com/configuring-qt-for-opencv-on-osx/

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If you used homebrew to install OpenCV they are likely already built in release mode.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          0
          • SGaistS SGaist

            If you used homebrew to install OpenCV they are likely already built in release mode.

            A Offline
            A Offline
            Arqam
            wrote on last edited by
            #5

            @SGaist No I didn't use homebrew and I completed my project and am at this stage where I cannot remove opencv.

            I followed the process as said. So what special should I do to build for release mode, if possible.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Who talked about removing anything ?

              I just asked whether you installed OpenCV through homebrew, nothing more. If you followed that tutorial, that's what I expected you did. If not then please explain how you did install/build OpenCV.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 2 Replies Last reply
              0
              • SGaistS SGaist

                Who talked about removing anything ?

                I just asked whether you installed OpenCV through homebrew, nothing more. If you followed that tutorial, that's what I expected you did. If not then please explain how you did install/build OpenCV.

                A Offline
                A Offline
                Arqam
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • SGaistS SGaist

                  Who talked about removing anything ?

                  I just asked whether you installed OpenCV through homebrew, nothing more. If you followed that tutorial, that's what I expected you did. If not then please explain how you did install/build OpenCV.

                  A Offline
                  A Offline
                  Arqam
                  wrote on last edited by
                  #8

                  @SGaist I have modified the question, please have a look.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Did you check the other folders of your app bundle ? What do you get if you run otool on what you find there ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    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