title: iOS project fails to compile under xcodebuild for deployment target 7.0, but is fine for 6.0. Compiles for both under Xcode
body: <p>I have an iOS project that has iOS 6.0 as a deployment target. It builds fine both under Xcode and xcodebuilder (necessary for CI). However the client now wants the project to only be available for users who have iOS7+ installed.</p>
  
  <p>No problem, I'll just increase the deployment target number right? Wrong!</p>
  
  <p>Under Xcode the project continues to compile just fine. Under xcodebuild however, the project fails to compile with lots of errors like this:</p>
  
  <blockquote>
    <p>Undefined symbols for architecture armv7:<br>
    "std::string::_Rep::_S_empty_rep_storage", referenced from:
           in drmNativeInterface</p>
  </blockquote>
  
  <p>It's using <code>Adobe Primetime</code> and <code>drmNativeInterface</code> is part of that.</p>
  
  <p>To help isolate the problem I've created a brand new, single-screen project and performed the following changes:</p>
  
  <ul>
  <li><p>Added the <code>drmNativeInterface</code> framework and the two Apple-supplied dependencies that are required for the project to build in Xcode, <code>MediaPlayer</code> and <code>AVFoundation</code> to <code>"Link Binary with Libraries"</code>. The Primetime documentation lists other dependencies as well but it makes no difference if I add those - these are the only 2 that are needed for a successful build under Xcode.</p></li>
  <li><p>Replaced the valid archs <code>"arm64 armv7 armv7s"</code> with <code>"armv6 armv7 armv7s"</code> (even though drmNativeInterface apparently contains i386, x86_64, armv7s and arm64 slices, even Xcode won't compile the project unless I switch arm64 for armv6).</p></li>
  <li><p>Set <code>"Build Active Architecture Only"</code> to NO for both configurations.</p></li>
  <li><p>And finally, added <code>"-lstdc++ -ObjC -all_load"</code> to <code>"Other Linker Flags"</code>.</p></li>
  </ul>
  
  <p>Other than those few steps above, the project is stock single-screen: no code has been added.</p>
  
  <p>Xcode will compile it but xcodebuild will not. For xcodebuild to compile it I have to switch the deployment target to 6.0 which defeats the client's request.</p>
  
  <p>The CI xcodebuild command contains a few params but here's the minimised command I'm using for this test project:</p>
  
  <blockquote>
    <p>xcodebuild -project <code>"MyProject.xcodeproj"</code> -scheme <code>"MyProject"</code></p>
  </blockquote>
  
  <p>I've tried adding <code>FRAMEWORK_SEARCH_PATHS</code>, <code>HEADER_SEARCH_PATHS</code> and <code>ALWAYS_SEARCH_USER_PATHS</code> params in case xcodebuild was simply unable to use the paths contained within the project file but that made no difference.</p>
  
  <p>If I remove the <code>drmNativeInterface</code> framework from the project - leaving the 2 Apple-based dependencies alone - the project compiles just fine for both Xcode and xcodebuild. But obviously this isn't a solution because I need that framework!</p>
  
  <p>Does anyone have any idea what could be causing this or how to fix it?</p>
  
  <p>**NB: **</p>
  
  <blockquote>
    <p>There are a lot of questions on SO where projects will build in Xcode and not in xcodebuilder, but I couldn't find any where a project will build in xcodebuilder just fine for one deployment target and not for another.</p>
  </blockquote>
  
  <p>Thanks in advance.</p>