title: How to config xCode 4 to compile objective-c++ without adding a '.mm' file
body: <p>I am trying to describe my problem clearly for you, so it might be a little long, and I really appreciate that if you can read it and provide some suggestion. Thanks.  </p>
  
  <p>I have a library project, let's call it <code>MyCppLib</code>, which contains some legacy c++ code, and I add a adapter class in this project so that I can use it with out using objective-c++ in other project. Here is an overview of <code>MyCppLib</code> project.  </p>
  
  <p><strong>Project <em>MyCppLib</em></strong><br>
  - <em>some legacy c++ code</em><br>
  - Adapter.h<br>
  - Adapter.mm  </p>
  
  <p>I have another project, let's call it <code>Main</code> project, which use the <code>MyCppLib</code> project as a static library. So I use xCode 4 to compile <code>MyCppLib</code>, and get <code>libMyCppLib.a</code>, and config <code>Main</code> project in xCode 4 to link it with <code>Main</code> project. Here is an overview of <code>Main</code> project.  </p>
  
  <p><strong>Project <em>Main</em></strong><br>
  - <em>Some objective-c classes</em> <strong>which DO NOT contain '.mm' file</strong><br>
  - Adapter.h<br>
  - libMyCppLib.a <em>as a static library</em>  </p>
  
  <p>While I compile the <code>Main</code> project in xCode 4 I get some errors:</p>
  
  <blockquote>
    <p>Undefined symbols for architecture armv6:<br>
     "operator new(unsigned long)", referenced from:<br>
         -[Adapter init] in libMyCppLib.a(Adapter.o)<br>
         <em>my</em>::<em>cpp</em>::<em>namespace</em>::<em>MyCppClass</em>::<em>MyCppClass</em>()in libMyCppLib.a(<em>MyCppClass</em>.o)  </p>
    
    <p>... <em>some other similar errors</em></p>
    
    <p>ld: symbol(s) not found for architecture armv6<br>
    collect2: ld returned 1 exit status</p>
  </blockquote>
  
  <p>I figure it might because the <code>Main</code> project do not have an objective-c++ capability, so I add a '.mm' file to the <code>Main</code> project. And now <code>Main</code> project should be like this:  </p>
  
  <p><strong>Project <em>Main</em></strong><br>
  - <em>Some objective-c classes</em> <strong>which DO NOT contain '.mm' file</strong><br>
  - Adapter.h<br>
  - libMyCppLib.a <em>as a static library</em><br>
  - DummyObjCpp.h<br>
  - DummyObjCpp.mm  </p>
  
  <p>Then, I compile the <code>Main</code> project, and it <strong>succeed</strong>!  </p>
  
  <p>So, <em>finally</em>, my question is: how can I configure the <code>Main</code> project to have objective-c++ capability without adding a '.mm' file?</p>