title: Ubuntu 11.10: GCC/G++ won't link libraries
body: <p>I went to compile a project of mine, which uses SDL, SDL_ttf, OpenAL, and GTK. All of which are outputting errors like the following:</p>
  
  <pre><code>TxtFunc.cpp:(.text+0x61): undefined reference to `TTF_OpenFont'
  TxtFunc.cpp:(.text+0x8c): undefined reference to `TTF_RenderText_Solid'
  TxtFunc.cpp:(.text+0xf6): undefined reference to `SDL_UpperBlit'
  TxtFunc.cpp:(.text+0x108): undefined reference to `TTF_CloseFont'
  TxtFunc.cpp:(.text+0x114): undefined reference to `SDL_FreeSurface'
  </code></pre>
  
  <p>for every library call. I am compiling with the following link options:</p>
  
  <p><code>sdl-config --libs</code> <code>pkg-config gtk+-2.0 --libs</code> <code>pkg-config openal --libs</code> -lalut -lSDL_ttf</p>
  
  <p>I have all of these packages installed, and there are no "file not found" errors. Just a lot of undefined references... It didn't make sense, so I wrote up a quick test application:</p>
  
  <pre><code>#include "SDL/SDL.h"
  
  int main()
  {
      SDL_Init(SDL_INIT_VIDEO);
      return 0;
  }
  </code></pre>
  
  <p>and compile like so:</p>
  
  <pre><code>g++ `sdl-config --libs --cflags` -o sdl-test ./sdl-test.cpp
  </code></pre>
  
  <p>I have even tried linking directly to "/usr/lib/libSDL-1.2.so.0" or "/usr/lib/libSDL.a" instead</p>
  
  <p>all of these options end up with the same output:</p>
  
  <pre><code>/tmp/cc05XT8U.o: In function `main':
  sdl-test.cpp:(.text+0xa): undefined reference to `SDL_Init'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Anybody have any ideas?</p>