1 Reply
      Latest reply: Jan 17, 2017 3:05 PM by eskimo RSS
      hherglotz Level 1 Level 1 (0 points)

        I am building a C++ application with Xcode 7 on OS X 10.10. My application has deployment target set to 10.7, but I need to link against static libraries that have newer deployment target (10.10). It is not possible to change the deployment target of these libraries. Can I link agaist them anyway?

        Thanks

        • Re: Static libraries with different deployment target
          eskimo Apple Staff Apple Staff (7,960 points)

          Can I link agaist them anyway?

          No.  Well, you might be able to get it to link, and it might even work if you’re lucky, but it’s most definitely not supported.  All components of a linked Mach-O image must use the same deployment target.  I’ve seen some wacky and very hard-to-track-down bugs caused by folks not following that rule.

          One option is to put the older libraries in their own Mach-O image (a dylib, framework, or bundle).  It’s fine to have different deployment targets across image boundaries.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"