title: Linking SDL2 emits countless linking errors on OSX
body: <p>I have this super simple SDL2 executable: </p>
  
  <pre><code>#include &lt;SDL.h&gt;
  
  int main(void)
  {
      SDL_Texture* t;
      SDL_DestroyTexture(t);
  }
  </code></pre>
  
  <p>I try to compile it like this:</p>
  
  <pre><code>clang++ $(sdl2-config --cflags --libs) foo.cc 
  </code></pre>
  
  <p>This grants me with a barrage of Linking errors, which all have to do with Objective-C and Apple Libraries. I can do the same with <code>SDL_Surface* s; SDL_DestroySurface(s);</code> and it won't emit these errors.</p>
  
  <p>I have found out that I can solve this problem by using <code>$(sdl2-config --static-libs)</code>. But I'm pretty sure, I shouldn't need to use this. After all shouldn't the SDL2 library already be linked to them? Why is it only appearing with SDL_Texture, but not with SDL_Surface? What am I doing wrong?</p>
  
  <p>EDIT: I don't know why I got the downvote. Here I have a small sample of the linking errors:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "_AudioObjectAddPropertyListener", referenced from:
        _COREAUDIO_Init in libSDL2.a(SDL_coreaudio.o)
        _COREAUDIO_OpenDevice in libSDL2.a(SDL_coreaudio.o)
    "_AudioObjectGetPropertyData", referenced from:
        _COREAUDIO_OpenDevice in libSDL2.a(SDL_coreaudio.o)
        _device_unplugged in libSDL2.a(SDL_coreaudio.o)
        _build_device_list in libSDL2.a(SDL_coreaudio.o)
    "_AudioObjectGetPropertyDataSize", referenced from:
    (...)
  </code></pre>