Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Subdirs project and dyld: Library not loaded
Forum Updated to NodeBB v4.3 + New Features

Subdirs project and dyld: Library not loaded

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 2.2k 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.
  • D Offline
    D Offline
    dpwrussell
    wrote on last edited by
    #1

    I'm quite new to Qt and have been using it painlessly on Linux for a while, but when I came to move my project over to my OSX laptop to go on the road I just can't understand what's happening. I've read that there is a "problem with debugging on snow leopard":http://doc.qt.digia.com/qtcreator-2.4/creator-troubleshooting-debugging.html but as I've set it to release and still get the problem I think it must be something else.

    I created a simple test case to see if a fresh project would exhibit the same problem and it did. Here is what I did:

    Create new subdirs project.
    Create a C++ shared lib as a child
    Create a Console App as a child.
    Right-click the Console App and add the C++ library as a library. This gets added to the .pro

    @win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../ASharedLib/release/ -lASharedLib
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../ASharedLib/debug/ -lASharedLib
    else:symbian: LIBS += -lASharedLib
    else:unix: LIBS += -L$$OUT_PWD/../ASharedLib/ -lASharedLib

    INCLUDEPATH += $$PWD/../ASharedLib
    DEPENDPATH += $$PWD/../ASharedLib@

    Builds fine, but when I try and run it:

    @dyld: Library not loaded: libASharedLib.1.dylib
    Referenced from: /Users/douglas/Code/QT/OSXSubdirsFailure-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Release/AConsoleApp/AConsoleApp
    Reason: image not found
    Press <RETURN> to close this window...@

    What's going on?

    I zipped up the whole thing including the build directories: http://dl.dropbox.com/u/81303672/CodeExamples/OSXSubDirsStuff.zip

    Thanks.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hipersayan_x
      wrote on last edited by
      #2

      I'm not sure but maybe you must load the library before to call the app:

      https://blogs.oracle.com/DatabaseEmporium/entry/where_is_ld_preload_under

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dpwrussell
        wrote on last edited by
        #3

        I don't think this is the answer. LD_PRELOAD (and by the looks of it, the OSX equivalent) is used for overriding system libraries.

        Any other ideas?

        [quote author="hipersayan_x" date="1355893677"]I'm not sure but maybe you must load the library before to call the app:

        https://blogs.oracle.com/DatabaseEmporium/entry/where_is_ld_preload_under
        [/quote]

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dpwrussell
          wrote on last edited by
          #4

          What does need to be set is something like:

          @export DYLD_LIBRARY_PATH="../ASharedLib/:$DYLD_LIBRARY_PATH"@

          but I can't see any way to do this in Qt Creator settings or in the qmake reference guide.

          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