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. dyld: Library not loaded when debugging but ok when running (on OS X El Capitan) [SOLVED]

dyld: Library not loaded when debugging but ok when running (on OS X El Capitan) [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
osxdylibdebug
10 Posts 2 Posters 5.0k 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.
  • U Offline
    U Offline
    ucmar
    wrote on 5 Oct 2015, 20:29 last edited by ucmar 10 Aug 2015, 14:58
    #1

    Hi all, I upgraded recently my OS X to 10.11 (El Capitan) and Xcode 7.0.1, I am unable to debug my custom libraries-based project. In particular, the project builds and runs correctly, but when starting in debug mode, i get the following message:

    dyld: Library not loaded: libquGUI.1.dylib
    Referenced from: /Users/ucmar/Repositories/build-quTestGUI-Desktop_Qt_5_5_0_clang_64bit-Debug/quTestGUI.app/Contents/MacOS/quTestGUI
    Reason: image not found

    Does anyone experience the same problem or have an idea on how to fix this? On Yosemite everything worked properly... Thank you in advance!

    Mario

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Oct 2015, 23:35 last edited by
      #2

      Hi,

      From a recent thread on the mailing list, it seams that with El Capitan Apple modified the handling of the DYLD_* variables that are used to find frameworks/dylibs so it might be related to that

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

      U 1 Reply Last reply 5 Oct 2015, 23:43
      0
      • S SGaist
        5 Oct 2015, 23:35

        Hi,

        From a recent thread on the mailing list, it seams that with El Capitan Apple modified the handling of the DYLD_* variables that are used to find frameworks/dylibs so it might be related to that

        U Offline
        U Offline
        ucmar
        wrote on 5 Oct 2015, 23:43 last edited by
        #3

        Thanks @SGaist. The weird thing is that when doing a simple run, everything works properly. It looks like the debugger uses a different set of env variables than the ones in the run project settings. Or maybe there might be different env variable than DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH?

        This error is very annoying because it makes it hard or impossible to debug a libs based app! I hope Apple fixes it soon!

        ps. Do you think this error appears in Xcode libs based projects, too?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 Oct 2015, 19:25 last edited by
          #4

          One thing you can try:

          • Close your project
          • Delete the .pro.user file (or rename it to something else
          • Re-open the project (you'll have to reconfigure it)

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

          U 1 Reply Last reply 7 Oct 2015, 22:23
          0
          • S SGaist
            7 Oct 2015, 19:25

            One thing you can try:

            • Close your project
            • Delete the .pro.user file (or rename it to something else
            • Re-open the project (you'll have to reconfigure it)
            U Offline
            U Offline
            ucmar
            wrote on 7 Oct 2015, 22:23 last edited by
            #5

            @SGaist thanks, but I have just tried it and it doesn't work. This issue is really making debugging impossible... I hope a workaround can be found! I have been googling around but nothing so far.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 7 Oct 2015, 22:34 last edited by
              #6

              Might be a silly question but did you also nuke the shadow build folder ?

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

              U 1 Reply Last reply 7 Oct 2015, 22:38
              0
              • S SGaist
                7 Oct 2015, 22:34

                Might be a silly question but did you also nuke the shadow build folder ?

                U Offline
                U Offline
                ucmar
                wrote on 7 Oct 2015, 22:38 last edited by
                #7

                @SGaist yep...

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 7 Oct 2015, 22:46 last edited by
                  #8

                  One last thing you can check is whether you can debug with Xcode itself

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

                  U 2 Replies Last reply 7 Oct 2015, 22:48
                  0
                  • S SGaist
                    7 Oct 2015, 22:46

                    One last thing you can check is whether you can debug with Xcode itself

                    U Offline
                    U Offline
                    ucmar
                    wrote on 7 Oct 2015, 22:48 last edited by
                    #9

                    Good call. I'll try and let you know...

                    1 Reply Last reply
                    0
                    • S SGaist
                      7 Oct 2015, 22:46

                      One last thing you can check is whether you can debug with Xcode itself

                      U Offline
                      U Offline
                      ucmar
                      wrote on 8 Oct 2015, 01:02 last edited by ucmar 10 Aug 2015, 12:40
                      #10

                      ok after some further research I have found this page (probably the one you @SGaist were referring to) https://forums.developer.apple.com/thread/9233.

                      As you mentioned, it seems that DYLD_* variables have been disabled (they are ignored) since El Capitan because of a new feature called System Integrity Protection (SIP). According to Apple Developer website, debugging can be happily performed only by Xcode (although I haven't tried it yet). What about Qt? Will 5.5.1 or 5.6 allow debugging on El Cap with SIP?

                      I read on another page SIP can be disabled in Recovery mode. Anyway, I am not keen at hacking my own system... the alternative is to wait for the next version of Qt and hope for a solution. Unsure what to do for now, in the meanwhile I am stuck! Grrr

                      UPDATE: I ended up disabling SIP following the following step:

                      1. Enter Recovery mode (Cmd+R on startup)
                      2. Open Terminal
                      3. csrutil disable; reboot

                      Now debugging went back to normality!

                      My only doubt is that when i do csrutil status, I receive the following message:

                      "System Integrity Protection status: enabled (Custom Configuration).

                      Configuration:
                      Apple Internal: disabled
                      Kext Signing: disabled
                      Filesystem Protections: disabled
                      Debugging Restrictions: disabled
                      DTrace Restrictions: disabled
                      NVRAM Protections: disabled

                      This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state."

                      Not very reassuring uh? (and why is that still saying SIP enabled?)

                      1 Reply Last reply
                      0

                      2/10

                      5 Oct 2015, 23:35

                      8 unread
                      • Login

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