title: Linker error calling .mm function from .cpp file
body: <p>I've added a obj-c class (.mm and 2 headers) to my current Xcode 4.6 project. One header file has the prototype to call to the obj-c class and the other defines the .mm class. Here's what it looks like.</p>
  
  <p>myinterface.h</p>
  
  <pre><code>#ifndef MYINTERFACE_H
  #define MYINTERFACE_H
  
  BOOL LaunchApp(CAtlString exePath);
  
  #endif
  </code></pre>
  
  <p>myLaunchClass.h</p>
  
  <pre><code>#import "myinterface.h"
  
  @interface myLaunchClass : NSObject
  -(BOOL) LaunchApp:(CAtlString)exePath;
  @end
  </code></pre>
  
  <p>myLaunchClass.mm</p>
  
  <pre><code>@import "myLaunchClass.h"
  
  @implementation myLaunchClass
  -(BOOL) LaunchApp:(CAtlString)exePath
  {
      ....
      return someCondition;
  }
  @end
  </code></pre>
  
  <p>From there it compiles good. I added the .mm file to the Target in the Build Phases and the header location to the Header Search Paths in the Build Settings.</p>
  
  <p>When I include the header file in my .cpp file (<code>#include "myinterface.h"</code>) I have no errors. However, when I call my function (<code>::LaunchApp(exePath);</code>), I a linker error.</p>
  
  <p>Error</p>
  
  <pre><code>Undefined symbols for architecture i386:
    "LaunchApp(CAtlString)", referenced from:
        myCppFile::myCppFunction() const in myCppFile.o
  ld: symbol(s) not found for architecture i386
  </code></pre>
  
  <p>Any ideas? I think it must be an obvious mistake for a Mac developer but I'm a bit new still with Mac programming. Any help is appreciated.</p>