title: Xcode and C++ Headers
body: <p>I have a question about using C++ header files in Objective-C++ modules in Xcode. Specifically, why can I #include them in source files but not header files?</p>
  
  <p>Here is a specific example.</p>
  
  <p>I'm using Xcode 7.2.1 and have two projects. The first is a C++ framework I package into "myFramework.framework". It exposes "myFramework.h", which in turn pulls in "myLib.h".  At the top of "myLib.h" is an "#include &lt;string&gt;".</p>
  
  <p>The second project is an Objective-C iOS app which consumes the above framework. In this project, "myViewController.mm" (Objective-C++ source) has "#import "myFramework/myFramework.h" at the top and makes reference to things defined in that header file.</p>
  
  <p>At this point all is well and good.  It builds and runs with no issues.</p>
  
  <p>When I move the "#import myFramework/myFramework.h" line to "myViewController.h", the compile fails because it cannot locate the "" header dependency.</p>
  
  <p>It doesn't matter if I change the file type for "myViewController.h" to Objective-C++ header from plain old "C Header".  Either way, Xcode's header search paths don't look for standard C++ headers.</p>
  
  <p>So my main question is why does it behave this way? Why is a #include/#import treated differently just because it's in a header file?</p>
  
  <p>My second question is if there's some way to make Xcode treat the #include/#import the same when it's in the header file instead of the source file?</p>
  
  <p>Thanks much!</p>