title: Link with Cocoa Framework from C++ and Objective-C++
body: <p>I'm trying to use a Cocoa Framework (MultitouchSupport, to be specific) from within a basic Objective-C++ file, but I keep getting undefined symbol errors, as if g++ is supposed to have different linker flags than gcc.</p>
  
  <p>My ultimate goal is to integrate a C++ networking library with some basic Objective-C code I got from here: <a href="http://steike.com/code/multitouch/" rel="nofollow">http://steike.com/code/multitouch/</a>.</p>
  
  <p>When I run this to compile the original code, it works fine:</p>
  
  <pre><code>gcc -F/System/Library/PrivateFrameworks -framework MultitouchSupport test.m -o test -std=c99
  </code></pre>
  
  <p>But when I rename the file to <code>test.mm</code>, so that it can later include and reference C++ files, the following doesn't work:</p>
  
  <pre><code>g++ -F/System/Library/PrivateFrameworks -framework MultitouchSupport test.mm -o test
  </code></pre>
  
  <p>And gives me these errors:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "MTDeviceCreateDefault()", referenced from:
      _main in ccq0vzuM.o
  "MTRegisterContactFrameCallback(void*, int (*)(int, Finger*, int, double, int))", referenced from:
      _main in ccq0vzuM.o
  "MTDeviceStart(void*, int)", referenced from:
      _main in ccq0vzuM.o
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  make: *** [testpp] Error 1
  </code></pre>
  
  <p>What do I need to do in order for this Objective-C++ file to see the Framework I'm looking for so I can use C++ with it?</p>
  
  <p>Thanks!</p>