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. Adding 3rd party libraries for deployment
Forum Updated to NodeBB v4.3 + New Features

Adding 3rd party libraries for deployment

Scheduled Pinned Locked Moved Unsolved General and Desktop
21 Posts 3 Posters 6.2k Views 2 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 Arqam

    I have completed my project but it is using some 3rd party library like opencv. I have configured this library in my local but have to now deploy my project.

    On running otool -L MyApplication.app/Contents/MacOS/MyApplication it gives me the following result :

    XMLGeneratorApp.app/Contents/MacOS/XMLGeneratorApp:
    	@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.10.0, current version 5.10.0)
    	@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.10.0, current version 5.10.0)
    	@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.10.0, current version 5.10.0)
    	/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.10.0, current version 5.10.0)
    	/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)
    

    So before doing macdeployqt ./MyApplication.app what should I do to add those libraries or will it be done automatically if I run macdeployqt ?

    raven-worxR Offline
    raven-worxR Offline
    raven-worx
    Moderators
    wrote on last edited by
    #2

    @Arqam said in Adding 3rd party libraries for deployment:

    So before doing macdeployqt ./MyApplication.app what should I do to add those libraries or will it be done automatically if I run macdeployqt ?

    doesn't wait for the answer take longer than to check it yourself by simply calling the command?? o.O

    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
    If you have a question please use the forum so others can benefit from the solution in the future

    A 2 Replies Last reply
    0
    • raven-worxR raven-worx

      @Arqam said in Adding 3rd party libraries for deployment:

      So before doing macdeployqt ./MyApplication.app what should I do to add those libraries or will it be done automatically if I run macdeployqt ?

      doesn't wait for the answer take longer than to check it yourself by simply calling the command?? o.O

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

      @raven-worx My project crashes in few cases https://forum.qt.io/topic/82746/creating-dmg-for-qt-app-mac-osx/19

      1 Reply Last reply
      0
      • raven-worxR raven-worx

        @Arqam said in Adding 3rd party libraries for deployment:

        So before doing macdeployqt ./MyApplication.app what should I do to add those libraries or will it be done automatically if I run macdeployqt ?

        doesn't wait for the answer take longer than to check it yourself by simply calling the command?? o.O

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

        @raven-worx Just running macdeployqt ./MyApplication.app will allow the dmg to run the application in my local. But when I send the application to other systems, it will not be able to even open the window.

        It should be because of the external libraries being used. Because when I sent a sample default application without any external library it worked perfectly. Can you please tell how to solve this problem

        raven-worxR 1 Reply Last reply
        0
        • A Arqam

          @raven-worx Just running macdeployqt ./MyApplication.app will allow the dmg to run the application in my local. But when I send the application to other systems, it will not be able to even open the window.

          It should be because of the external libraries being used. Because when I sent a sample default application without any external library it worked perfectly. Can you please tell how to solve this problem

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #5

          @Arqam
          OSX Deployment docs:

          To include a 3rd party library in the application bundle, copy the library into the bundle manually, after the bundle is created.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          A 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @Arqam
            OSX Deployment docs:

            To include a 3rd party library in the application bundle, copy the library into the bundle manually, after the bundle is created.

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

            @raven-worx How to do that?
            I see people saying to use install_name_tool but in my case which folder should I add in what location?

            raven-worxR 1 Reply Last reply
            0
            • A Arqam

              @raven-worx How to do that?
              I see people saying to use install_name_tool but in my case which folder should I add in what location?

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #7

              @Arqam
              you may want to take a look at macdylibbundler
              I am not very experienced with MacOSX development. Maybe @SGaist can help here?

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              A 2 Replies Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                What exact error do you get with OpenCV ?

                You can crank up the verbose level to get more information about what exactly is going on.

                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

                  What exact error do you get with OpenCV ?

                  You can crank up the verbose level to get more information about what exactly is going on.

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

                  @SGaist I have to do something extra for including external library (opencv here) with my project before macdeployqt right?
                  I want to know what I need to do to add external libraries so that the app works in deployment.

                  1 Reply Last reply
                  0
                  • raven-worxR raven-worx

                    @Arqam
                    you may want to take a look at macdylibbundler
                    I am not very experienced with MacOSX development. Maybe @SGaist can help here?

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

                    @raven-worx said in Adding 3rd party libraries for deployment:

                    macdylibbundler

                    We have to manually copy the required libraries to our .app folder right.
                    Apart from copying do we need to do anything else?

                    1 Reply Last reply
                    0
                    • raven-worxR raven-worx

                      @Arqam
                      you may want to take a look at macdylibbundler
                      I am not very experienced with MacOSX development. Maybe @SGaist can help here?

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

                      @raven-worx What command should I use to get all the dependecies of all the external libraries for macdylibbundler. As the read me didn't tell what to use.

                      raven-worxR 1 Reply Last reply
                      0
                      • A Arqam

                        @raven-worx What command should I use to get all the dependecies of all the external libraries for macdylibbundler. As the read me didn't tell what to use.

                        raven-worxR Offline
                        raven-worxR Offline
                        raven-worx
                        Moderators
                        wrote on last edited by
                        #12

                        @Arqam said in Adding 3rd party libraries for deployment:

                        As the read me didn't tell what to use.

                        Really? Not even on the very bottom of the page?!

                        % dylibbundler -od -b -x ./HelloWorld.app/Contents/MacOS/helloworld
                        -d ./HelloWorld.app/Contents/libs-ppc/ -p @executable_path/../libs-ppc/

                        % dylibbundler -od -b -x ./HelloWorld.app/Contents/MacOS/helloworld
                        -d ./HelloWorld.app/Contents/libs-intel/ -p @executable_path/../libs-intel/

                        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                        If you have a question please use the forum so others can benefit from the solution in the future

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

                          If your dependencies are built/installed properly, there's nothing special to do because macdeployqt should be able to locate the files based on the information within your application binary since it uses macOS tools to do its magic.

                          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

                            If your dependencies are built/installed properly, there's nothing special to do because macdeployqt should be able to locate the files based on the information within your application binary since it uses macOS tools to do its magic.

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

                            @SGaist But after macdeployqt we have to copy the 3rd party library to our Content/Frameworks folder right?

                            1 Reply Last reply
                            0
                            • SGaistS SGaist

                              If your dependencies are built/installed properly, there's nothing special to do because macdeployqt should be able to locate the files based on the information within your application binary since it uses macOS tools to do its magic.

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

                              @SGaist I tried running in a different system, there when I saw the QT frameworks were proper inside the Content/Framework folder but the opencv libraries that I copied in the Framework folder were not proper. And the dmg app was not running.
                              What should I do apart from copying the library in the Framework folder?

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

                                Did you take a look at the macOS deployment guide ?

                                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

                                  Did you take a look at the macOS deployment guide ?

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

                                  @SGaist said in Adding 3rd party libraries for deployment:

                                  macOS deployment guide

                                  Yeah I did look into that. My project which is not using any external library works fine, but this one which is using openCV is not working. I have uploaded the build directory folder, can you please have a look : https://github.com/torrtuga/QTBuildApp

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

                                    How did you install OpenCV in the first place ?

                                    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
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #19

                                      By the way, you copied the symbolic link in your bundle not the actual libraries.

                                      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

                                        By the way, you copied the symbolic link in your bundle not the actual libraries.

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

                                        @SGaist Hi, thanks a lot for the reply.

                                        I followed the instructions here to configure openCV to my QT project : https://www.learnopencv.com/configuring-qt-for-opencv-on-osx/

                                        I had openCV in my system from earlier only.

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

                                          How did the OpenCV links get into the application bundle ?

                                          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