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. Library not found on Mac OS
Forum Updated to NodeBB v4.3 + New Features

Library not found on Mac OS

Scheduled Pinned Locked Moved Solved General and Desktop
librarymac os
23 Posts 2 Posters 11.7k 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
    Amott
    wrote on 1 Aug 2016, 12:39 last edited by
    #1

    Hello everyone,

    I'm facing a new problem with my project and I have trouble to solve it.

    I have an application that runs on Windows, and I have successfully compile it for Mac OS. The application starts but it catches me an exception "file not found: RecomputeDimBlock.tx".
    This exception is launched from an ODA function (ODA is an external lib used for this project).
    After some research I found that this function search the library into myapp.app/Contents/MacOS.

    I placed the library into this folder but it still doesn't detect it...
    I have try to follow these steps on this thread : https://forum.qt.io/topic/59209/solved-osx-deployment-fatal-error-with-dylib-library-not-loaded-image-not-found/4 but it still not find the lib.

    And then I have try with the command macdeploy and I have got this error :
    Error: no file at "/isr/lib/libMdCore.1.dylib"
    Error: no file at "/isr/lib/libMdWidget.1.dylib"
    Error: no file at "/isr/lib/libMdModels.1.dylib"

    that is normal because those lib are in my debug folder, why does he looking for those lib here ?

    Thanks in advance for your help !

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 1 Aug 2016, 22:26 last edited by
      #2

      Hi,

      Call otool -L on these libraries to get the shared lib informations.

      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
      • A Offline
        A Offline
        Amott
        wrote on 2 Aug 2016, 07:09 last edited by
        #3

        Here is the output

        RecomputeDimBlock.tx:
        	@loaderpath/RecomputeDimBlock.tx (compatibility version 0.0.0, current version 0.0.0)
        	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
        	/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.0.0)
        	libTD_Db.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libTD_DbRoot.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libTD_Gi.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libTD_SpatialIndex.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libTD_Ge.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libsisl.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libTD_Root.dylib (compatibility version 0.0.0, current version 0.0.0)
        	libTD_Alloc.dylib (compatibility version 0.0.0, current version 0.0.0)
        	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
        	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
        

        I have checked, every lib listed are well placed except libSystem.B.dylib, which I cannot find on the Mac.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 Aug 2016, 10:38 last edited by
          #4

          What version of Qt are you using ?

          How did you call macdeployqt ? Also where did you call if from ?

          What version of OS X are you using ?

          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
          • A Offline
            A Offline
            Amott
            wrote on 2 Aug 2016, 12:08 last edited by
            #5

            I use Qt 5.7. I called macdeploy like that :

            /Users/developpement/Qt/5.7/clang_64/bin/macdeployqt MediaCad.app
            

            and I the output is :

            ERROR: no file at "/usr/lib/libMdCore.1.dylib"
            ERROR: no file at "/usr/lib/libMdWidgets.1.dylib"
            ERROR: no file at "/usr/lib/libMdModels.1.dylib"
            

            I call it from my .app directory.

            I have tried to call it with -verbose=3 and here is the output : http://textup.fr/172668xw

            I'm using OS X 10.11.5

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 2 Aug 2016, 21:07 last edited by
              #6

              Ok try with:

              Add

              QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
              

              to your libraries .pro file

              and

              QMAKE_RPATHDIR += /path_your_libs_dir/
              

              to your application .pro file

              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
              • A Offline
                A Offline
                Amott
                wrote on 3 Aug 2016, 08:13 last edited by
                #7

                So, I tried that but I still got the same error with macdeploy and the same exception in my app. Maybe I did it wrong :
                I add QMAKE_FLAGS_SONAME = -Wl, -install_name, @rpath/
                and in my app .pro : DEPENDPATH += ../debug

                I have tried to change the first one into QMAKE_FLAGS_SONAME = -Wl, -install_name, ../debug/ but still the same thing.

                The exception is about RecomputeDimBlock.tx, which is not a lib from me, so I can't apply anything to it

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 3 Aug 2016, 09:35 last edited by
                  #8

                  Why DEPENDPATH ? It's not the same thing as QMAKE_RPATHDIR .

                  Also, I'd rather try with the full path using the OUT_PWD variable with QMAKE_RPATHDIR

                  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
                  • A Offline
                    A Offline
                    Amott
                    wrote on 3 Aug 2016, 09:45 last edited by
                    #9

                    I just copy/paste the wrong line, I have tested with QMAKE_DIRPATH.
                    It didn't change with OUT_PWD.
                    Maybe there is a thing to do with command install_name_tool on all library ? I will take a look on this trail

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 3 Aug 2016, 10:09 last edited by
                      #10

                      Again, it's not QMAKE_DIRPATH, it's QMAKE_RPATHDIR

                      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
                      • A Offline
                        A Offline
                        Amott
                        wrote on 3 Aug 2016, 12:08 last edited by
                        #11

                        erf... I should go back to school and learn to read again !
                        so now I have : QMAKE_RPATHDIR=OUT_PWD/../debug
                        but, nothing has changed

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 3 Aug 2016, 12:24 last edited by
                          #12

                          Did you forgot the double $ before OUT_PWD?

                          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
                          • A Offline
                            A Offline
                            Amott
                            wrote on 3 Aug 2016, 12:52 last edited by
                            #13

                            Oh... Yes... It explains why it didn't work !
                            The command macdeploy now works fine ! A lot a thing appeared in the .app. But the .tx is still not detected even after copying it on the right directory

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 3 Aug 2016, 13:57 last edited by
                              #14

                              Can you remind me what these .tx files are ?

                              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
                              • A Offline
                                A Offline
                                Amott
                                wrote on 3 Aug 2016, 14:03 last edited by
                                #15

                                In my case .tx is a lib provided by ODA library.
                                When my app start, I use a function "loadapp" from ODA, to load my .tx. After debugging it seams that this function is looking for the tx into <myapp.app>/Contents/MacOS directory, so I placed my lib here but it still doesn't detect it

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 3 Aug 2016, 22:00 last edited by
                                  #16

                                  macdeployqt won't handle them because it currently only targets .framework and .dylib.

                                  If we want to nitpick, putting "plugin" in the MacOS folder is wrong from a bundle point of view.

                                  You have to write a script that copies these .tx file at the right place and call install_name_tool on them to update the paths to all their dependencies (excluding the system libraries)

                                  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
                                  • A Offline
                                    A Offline
                                    Amott
                                    wrote on 4 Aug 2016, 07:47 last edited by
                                    #17

                                    ok so if I understood correctly, I have to write a script that first build my .app, then copy the .tx into MacOS and finally apply install_name_tool ?

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 4 Aug 2016, 07:49 last edited by
                                      #18

                                      Not necessarily. I was more thinking about a post-macdeployqt script that would handle the .tx files.

                                      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
                                      • A Offline
                                        A Offline
                                        Amott
                                        wrote on 4 Aug 2016, 08:35 last edited by
                                        #19

                                        ok, given that I'm an intern and my internship will end next week, I prefer writing a bash script that makes everything, that will be easier for my workmate in the future.
                                        Is there anyway to tell Qt that it has to call this script after compiling ?

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on 4 Aug 2016, 08:50 last edited by
                                          #20

                                          What do you mean by everything ? Run macdeployqt or build your application + macdeployqt + .tx deployment ?

                                          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

                                          1/23

                                          1 Aug 2016, 12:39

                                          • Login

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