Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Osx weak link framework/dylib
Forum Updated to NodeBB v4.3 + New Features

Osx weak link framework/dylib

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 3.5k 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.
  • M Offline
    M Offline
    mirswith
    wrote on 1 Nov 2011, 23:06 last edited by
    #1

    Is it possible to weak link an osx framework as well as a dylib using QtCreator and if so, how?

    Thanks!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 1 Nov 2011, 23:29 last edited by
      #2

      [Moved to the tools forum]

      That has nothing to do with Qt Creator, it just calls regular make + makefiles. Just add the weak linked libraries to the LIBS variable:

      @
      LIBS += -weak_framework <framework_name>
      @

      PS: for weak linking of a library use

      @
      LIBS += -weak_library <library name>
      @

      See "Apple's documentation":http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html for details.

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mirswith
        wrote on 1 Nov 2011, 23:52 last edited by
        #3

        Thanks. I was just about to post my findings and found your answer. :)

        After diving into this I would have asked a different question of how to lazy load a shared library. I want strict linking on the symbols but to load the library only when needed. Also I apologize for not looking at the ld man page before asking this question (didn't occur to me); maybe it will save someone down the road some time. :)

        With that said, for those interested this is how to lazy load a shared library on osx:

        @-L../mylib/dir/ -lazy-lmylib@

        Thanks again!

        1 Reply Last reply
        0

        1/3

        1 Nov 2011, 23:06

        • Login

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