title: Compiling C/C++ application using SDL in OS X, linking problem
body: <p>I'm trying to compile a C/C++ program that uses SDL on a OS X 10.6.8 but I'm having some errors on the linking stage, the code compiles but fails to like due to some missing symbols. The error is:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "_CFBundleGetMainBundle", referenced from: 
    -[SDLMain setupWorkingDirectory:] in libSDLmain.a(SDLMain.o)
    _main in libSDLmain.a(SDLMain.o)
  "_CFBundleCopyBundleURL", referenced from:
    -[SDLMain setupWorkingDirectory:] in libSDLmain.a(SDLMain.o)
  "_CFURLCreateCopyDeletingLastPathComponent", referenced from:
    -[SDLMain setupWorkingDirectory:] in libSDLmain.a(SDLMain.o)
  "_CFURLGetFileSystemRepresentation", referenced from:
    -[SDLMain setupWorkingDirectory:] in libSDLmain.a(SDLMain.o)
  "_CFRelease", referenced from:
    -[SDLMain setupWorkingDirectory:] in libSDLmain.a(SDLMain.o)
  
  ...
  
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
    objc-class-ref in libSDLmain.a(SDLMain.o)
  ld: symbol(s) not found for architecture x86_64
  collect2: ld returned 1 exit status
  make: *** [dist/linwarrior] Error 1
  </code></pre>
  
  <p>I checked with the <code>file</code> command and the libraries are either x86_64 only or universal with both i386 and x86_64 versions.</p>
  
  <p>Is there a way for me to determine what exactly is causing this error? A way to check the libs that are being included or any way to help debug the problem?</p>
  
  <p>I don't know if it helps but this is what my Makefile creates, I removed file names to make it short, and the KNT flag is just something I'm using for preprocessor conditions:</p>
  
  <pre><code>/opt/local/bin/g++-mp-4.5 -DKNT=1 -Wp,-M,-MP,-MT,-MF, -std=c++0x -Wall -I source -O1 -funroll-loops -c -o
  </code></pre>
  
  <p>Thanks.</p>