title: SDL_Mixer 2.0.4 "MP3 support not available" even though libmpg123 is installed
body: <p>I am a beginner to programming and am trying to make a simple console MP3 player as a project. For this, I need a way to play <code>.mp3</code> files. SDL Mixer provides this facility but requires <code>libmpg123</code> installed on one's system.</p>
  
  <p>Call to 'Mix_Init()' always fails even though I have the required dependency 'libmpg123' installed. I do not have the dependencies for other formats i.e., FLAC, OGG, MOD and MIDI if that matters.</p>
  
  <p>I am running Ubuntu 18.04 on my laptop and I have SDL2 version 2.0.9, SDL_Mixer 2.0.4 both built from source (although I have tried the versions available through the <code>apt</code> package manager). I also have <code>libmpg123</code> installed which I have also built from source (again, I have also tried the version available through the package manager).</p>
  
  <p>I compiled the code in two ways:</p>
  
  <p><code>g++ Mix_Init.cpp -lSDL2 -lSDL2_mixer</code></p>
  
  <p>and</p>
  
  <p><code>g++ Mix_Init.cpp -lSDL2 -lSDL2_mixer -lmpg123</code></p>
  
  <p>I don't know which one is right but neither one fixes the problem.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include&lt;SDL2/SDL.h&gt;
  #include&lt;SDL2/SDL_mixer.h&gt;
  #include&lt;iostream&gt;
  
  int main(int argc, char** argv)
  {
      if(SDL_Init(SDL_INIT_AUDIO))
          std::cerr &lt;&lt; "SDL_Init() Error: " &lt;&lt; SDL_GetError() &lt;&lt; std::endl;
  
      else {
          int result {0};
          if(!((result = Mix_Init(MIX_INIT_MP3)) &amp;&amp; MIX_INIT_MP3)){
              std::cerr &lt;&lt; Mix_GetError() &lt;&lt; std::endl;
              std::cerr &lt;&lt; "Mix_Init() returns " &lt;&lt; result &lt;&lt; std::endl;
          }
          else {
              std::cout &lt;&lt; "Success!" &lt;&lt; std::endl;
          }
      }
      return 0;
  }
  </code></pre>
  
  <p>Here are the contents of my <code>/usr/local/lib</code> directory:</p>
  
  <pre><code>cmake           libmpg123.so.0.44.8  libSDL2-2.0.so.0      libSDL2main.la              libSDL2_mixer.so  pkgconfig
  libglfw3.a      libout123.la         libSDL2-2.0.so.0.9.0  libSDL2_mixer-2.0.so.0      libSDL2.so        python2.7
  libmpg123.la    libout123.so         libSDL2.a             libSDL2_mixer-2.0.so.0.2.2  libSDL2_test.a    python3.6
  libmpg123.so    libout123.so.0       libSDL2.la            libSDL2_mixer.a             libSDL2_test.la   python3.7
  libmpg123.so.0  libout123.so.0.2.2   libSDL2main.a         libSDL2_mixer.la            mpg123
  
  </code></pre>
  
  <p>I expect the output:</p>
  
  <pre><code>Success!
  </code></pre>
  
  <p>Instead I get:</p>
  
  <pre><code>MP3 support not available
  Mix_Init() returns 0
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Apparently, I have the other dependencies installed as well...</p>
  
  <p>But I have no idea how to use them.</p>
  
  <p><a href="https://i.stack.imgur.com/koywc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/koywc.png" alt="enter image description here"></a></p>