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. How to find out how libraries are linked via otool
Forum Updated to NodeBB v4.3 + New Features

How to find out how libraries are linked via otool

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 3 Posters 5.4k 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.
  • H Offline
    H Offline
    Hedge
    wrote on last edited by
    #1

    I have problems my application on OSX.
    I followed "this guide":http://doc.qt.nokia.com/qq/qq09-mac-deployment.html, but my application still tries to load qt and other libraries from ~/Frameworks/ folder.

    otool -L gives me this:

    @ kqoauth.framework/Versions/0/kqoauth (compatibility version 0.95.0, current version 0.95.0)
    QtDeclarative.framework/Versions/4/QtDeclarative (compatibility version 4.7.0, current version 4.7.3)
    QtScript.framework/Versions/4/QtScript (compatibility version 4.7.0, current version 4.7.3)
    QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
    QtSvg.framework/Versions/4/QtSvg (compatibility version 4.7.0, current version 4.7.3)
    QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
    QtSql.framework/Versions/4/QtSql (compatibility version 4.7.0, current version 4.7.3)
    QtXmlPatterns.framework/Versions/4/QtXmlPatterns (compatibility version 4.7.0, current version 4.7.3)
    QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.7.0, current version 4.7.3)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)@

    but it still doesn't use at least the kqoauth provided inside the framework-folder in the .app-folder.

    What can I do about this?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You should add the plugins directory of the bundle to the search path. This is what I do in my apps:

      @
      QStringList libPaths;

      #if defined( Q_OS_WIN32 )
      libPaths << app.applicationDirPath() + "/plugins";
      #elif defined( Q_OS_MACX )
      libPaths << app.applicationDirPath() + "/../PlugIns";
      #endif

      QApplication::setLibraryPaths( libPaths );
      qDebug() << "Plugin-DIRS:" << QApplication::libraryPaths();
      @

      The paths in the libs and the app should be relative to the executable path

      It should look like this:

      @
      @executable_path/../Frameworks/QtWebKit.framework/Versions/4/QtWebKit (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/QtSvg.framework/Versions/4/QtSvg (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/Qt3Support.framework/Versions/4/Qt3Support (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/QtSql.framework/Versions/4/QtSql (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.3)
      @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.7.0, current version 4.7.3)
      @

      The path for the libs used by the plugin must be the same.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Hedge
        wrote on last edited by
        #3

        Ok, it takes some time but I think I got it now.

        How do I find out which plugins I need?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          That depends on the features you use :-)

          This wiki page documents the "Library and Plugin Cross Dependencies":http://developer.qt.nokia.com/wiki/Qt_Library_Cross_Dependencies. Look for the plugins you know for sure you use (eg. SQL) and add the necessary dependencies.

          It's always a good idea to add the imageformats and iconengines plugins. They're not really big, so they should not harm size wise.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Hedge
            wrote on last edited by
            #5

            Thank you. That's a very good Wiki-page.

            I could successfully fix all dependencies.

            The only problem is a link pointing to a wrong location which leads to this error upon startup:

            @Qt internal error: qt_menu.nib could not be loaded. The .nib file should be placed in QtGui.framework/Versions/Current/Resources/ or in the resources directory of your application bundle.
            @

            Of course I can put qt_menu.nib in the resources-folder as mentioned but I'd rather fix the link (Current is pointing to /Library/Frameworks/QtGui.framework/Versions)

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              Yohann.V
              wrote on last edited by
              #6

              I just would to thank you, i spend a whole week on a similar issue and this page saved me. Thanks again.

              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