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. [SOLVED] MacOS runtime problem - dylb: Library not loaded

[SOLVED] MacOS runtime problem - dylb: Library not loaded

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 21.2k Views
  • 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
    maximus
    wrote on 30 Jun 2014, 20:42 last edited by
    #1

    I'm having hard time running my app on MacOSX.
    The .pro build just fine, but after when I tried to run the .app from inside QtCreator or outside, I get this error :

    dyld: Library not loaded: /Users/tourlou2/Qt/5.2.1/clang_64/lib/QtOpenGL.framework/Versions/5/QtOpenGL
    Referenced from: /Library/Frameworks/qwt.framework/Versions/6/qwt
    Reason: image not found
    Trace/BPT trap: 5

    I don't know why It checks in that folder for QtOpenGL, here is my Otool of qwt

    @otool -L /qwt.framework/Versions/6/qwt
    /Users/tourlou2/Dropbox/build-PowerVelo2-Desktop_Qt_5_2_1_clang_64bit-Release/MaximumTrainer.app/Contents/Frameworks/qwt.framework/Versions/6/qwt:
    @executable_path/../Frameworks/qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.0)
    @executable_path/../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.2.0, current version 5.2.1)
    @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.2.0, current version 5.2.1)
    @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.2.0, current version 5.2.1)
    @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.2.0, current version 5.2.1)
    @executable_path/../Frameworks/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.2.0, current version 5.2.1)
    @executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.2.0, current version 5.2.1)
    @executable_path/../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.2.0, current version 5.2.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/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)@

    Here is my framework structure after I build :
    https://www.dropbox.com/s/3n4fh4s46pm7opo/imageFrameWorks.png

    I even copied QOpenGL.framework to "/Users/tourlou2/Qt/5.2.1/clang_64/lib/QtOpenGL.framework/"
    Like it was requesting but I still have the same error

    Thanks if you can guide me a little!


    Free Indoor Cycling Software - https://maximumtrainer.com

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Jun 2014, 21:02 last edited by
      #2

      Hi,

      did you build Qwt with Qt 5.2.1 and are now using e.g. 5.3 ?

      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
      • M Offline
        M Offline
        maximus
        wrote on 30 Jun 2014, 21:58 last edited by
        #3

        No I just reinstalled
        "qt-opensource-mac-x64-clang-5.2.1.dmg"
        and uninstalled 5.3

        I can't even compile qwt now, I got error "qgl.h file not found"
        Seems to be related to openGL, ahh why did I try to upgrade -_-

        [Edit: reinstalled 5.3.1 on Mac, now I can compile qwt fine, I will check for my project tomorrow, thank]


        Free Indoor Cycling Software - https://maximumtrainer.com

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ambershark
          wrote on 30 Jun 2014, 22:26 last edited by
          #4

          It's looking in that folder because that is where it was linked when you built it. I had the same problem with some of the Qt files on my mac.

          Easiest thing to do is redirect where you want it to actually look i.e. your real Qt directory using otool on the Qt libs.

          Do an otool -L on the qwt framework to find where it is pointing then change that to your actual Qt install location, for instance /usr/local/Qt-5.2.1 or whatever you used for a prefix.

          As for reinstalling, qgl.h is contained as part of Qt. It shouldn't have trouble finding it. You can post the error parts of your build process and I can see if I spot anything for you.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maximus
            wrote on 1 Jul 2014, 13:16 last edited by
            #5

            Yes ambershark you are right, it is still pointing in my old Qt installation folder for OpenGL (dyld: Library not loaded:/ Users/tourlou2/Qt/5.2.1/clang_64/lib/QtOpenGL.framework/Versions/5/QtOpenGL)

            Qwt has just been recompiled with 5.3.1 and it shouldn't look for this old folder that no longer exist. I suspect it's my fault because I used "DYLD_LIBRARY_PATH" before and now I need to "unset" the old path, still looking for a command to do that. I should have never used the variable $DYLD_LIBRARY_PATH, otool is a better way.

            [Edit:
            If I run "set" on terminal", I get this line that is outdated :

            PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/tourlou2/qwt-6.1.0:/Users/tourlou2/Qt5.2.1/5.2.1/clang_64/bin
            ]


            Free Indoor Cycling Software - https://maximumtrainer.com

            1 Reply Last reply
            0
            • M Offline
              M Offline
              maximus
              wrote on 1 Jul 2014, 13:36 last edited by
              #6

              I cleared all the DYLIB_LIBRARY_PATH and PATH of my old Qt install

              I probably still have copied qwt.framework somewhere in the system file.
              I suck at Mac, how do you find a file "qwt.framework" on the whole disk? lol..
              https://www.dropbox.com/s/annixl5qrmt8a72/searchMac.png

              [Edit: Good, I found the old lib that was in /Library/Framework,
              deleted it, now I get the good version error at least :

              dyld: Library not loaded: qwt.framework/Versions/6/qwt
              Referenced from: /Users/tourlou2/Dropbox/build-PowerVelo2-Desktop_Qt_5_3_clang_64bit-Release/MaximumTrainer.app/Contents/MacOS/MaximumTrainer
              Reason: image not found

              Where is a good place to put "qwt.framework" library? I won't do the mistake of putting it in the system lib anymore. I tried to copy to Qt/5.3.1/5.3/clang64/lib but it's not loading


              Free Indoor Cycling Software - https://maximumtrainer.com

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maximus
                wrote on 1 Jul 2014, 13:59 last edited by
                #7

                Copied the new compiled with 5.3.1 "qwt.framework" library into "/Library/Framework". Working out so far, will have to remember to clear this library on future install/update.. thanks for the help


                Free Indoor Cycling Software - https://maximumtrainer.com

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 1 Jul 2014, 21:50 last edited by
                  #8

                  You can use install_name_tool to update the path of your library in your 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
                  • A Offline
                    A Offline
                    ambershark
                    wrote on 1 Jul 2014, 21:51 last edited by
                    #9

                    No problem, glad you got that all worked out.

                    If you don't want the framework at a system level you can put it anywhere you want. In your home directory under ~/Library/Frameworks would be a good place maybe.

                    Anyway, then you just have to point to it using something like the CFLAGS to the compiler when you want to use it.

                    Whatever works though. There is nothing wrong with system level as long as you remember it's there and need updating with the rest. :)

                    My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                    1 Reply Last reply
                    0

                    2/9

                    30 Jun 2014, 21:02

                    topic:navigator.unread, 7
                    • Login

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