title: Can you make an Objective-C++ subclass of a C++ class
body: <p>A multi-platform app I'm working on uses a different subclass of a single C++ class depending on the platform its running on. Can I make the OS X subclass an Objective-C++ (.mm) file without changing the superclass?</p>
  
  <p>Edit: more details</p>
  
  <p>The project, as it stands now contains this file hierarchy:</p>
  
  <pre><code>* VideoDriver.cpp   - (superclass)
    - VideoDriver_OSX.cpp - (subclass, contains Mac implementation)
    - VideoDriver_win.cpp - (subclass, contains Windows implementation)
    - VideoDriver_X11.cpp - (subclass, contains Linux implementation)
  </code></pre>
  
  <p>In short, I want to be able to use Core Animation and other Cocoa libraries in the VideoDriver_OSX implementation. Changing it to an Objective-C++ file (VideoDriver_OSX.mm) allows me to use these Cocoa libraries, but now the line of code (in a different file) that tries to instantiate the VideoDriver_OSX object causes this dynamic linker error at runtime:</p>
  
  <pre><code>dyld: lazy symbol binding failed: Symbol not found: __ZN15VideoDriver_OSXC1EP10gui_info_sP6CPFifoI17DecodedVideoFrameE
  </code></pre>
  
  <p>This seems to be related to C++ name mangling, but I don't know how to resolve it. I really appreciate the help, folks.</p>