title: Unresolved external symbols while building SDL2_mixer using Visual C++
body: <p>I am trying to build SDL2_mixer (2.0.2) using Microsoft Visual C++ in Visual  Studio, it appears that I have properly configured it.</p>
  <p>But seems that the two example projects <i>playmus</i> and <i>playwave</i> return errors (17 in total for each) regarding unresolved external symbols regarding <i>FLAC</i>(<strong>F</strong>ree <strong>L</strong>ossless <strong>A</strong>udio <strong>C</strong>odec) and <i>modplug</i>.</p>
  <p>Seems that I have properly linked them by adding <code>modplug.lib</code> and <code>libFLAC_static.lib</code> in the additional linker dependencies column for both the example projects.</p>
  <p>I have been trying to solve this problem because it is obvious that if these two example projects fail, then my project <b>using SDL2_mixer will also fail with these unresolved external symbol errors.</b></p>
  <p><i>And in the end, I was right. It happened... when I used it.</i></p>
  <p>So gracefully, is there a way to get rid of these linker errors (seems that I <strong>have</strong> properly linked them though).</p>
  <p>The errors are here (if you please):</p>
  <blockquote>
  <p>Error LNK2019: unresolved external symbol __imp__ModPlug_Load referenced in function _MODPLUG_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_process_until_end_of_stream referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_process_until_end_of_metadata referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_process_single referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_flush referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_finish referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_init_stream referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol
  __imp__FLAC__stream_decoder_get_state referenced in function _FLAC_Load
  Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_delete referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_new referenced in function _FLAC_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__ModPlug_SetMasterVolume referenced in function _MODPLUG_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__ModPlug_SetSettings referenced in function _MODPLUG_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__ModPlug_GetSettings referenced in function _MODPLUG_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__ModPlug_Seek referenced in function _MODPLUG_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__ModPlug_Read referenced in function _MODPLUG_Load
  Error LNK2019: unresolved external symbol __imp__ModPlug_Unload referenced in function _MODPLUG_Load</p>
  <p>Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_seek_absolute referenced in function _FLAC_Load</p>
  <p>Error LNK1120: 17 unresolved externals</p>
  </blockquote>
  <p>Additional Dependencies: (which I added while trying to solve these errors helplessly):-</p>
  <blockquote>
  <p>winmm.lib<br>
  version.lib<br>
  libmpg123-0.lib<br>
  modplug.lib<br>
  libFLAC_static.lib</p>
  </blockquote>
  <p>Preprocessor Settings: (Inside <strong>SDL2_mixer</strong> project):- (I suspect this <em>might</em> have something to do with this error but still looks all too well):-</p>
  <blockquote>
  <p>MUSIC_WAV<br>
  MUSIC_MOD_MODPLUG<br>
  MUSIC_OGG<br>
  MUSIC_FLAC<br>
  MUSIC_MP3_MPG123<br>
  MUSIC_MID_TIMIDITY<br>
  MUSIC_MID_NATIVE<br></p>
  </blockquote>
  <p>The errors are almost the same for both the projects.</p>
  <p>I grabbed <i>modplug</i> on <strong>GitHub</strong> from <a href="https://github.com/Konstanty/libmodplug" rel="nofollow noreferrer">here</a>, so it is not official.</p>
  <p><strong>&quot;</strong><i>And believe me, it is always a pain to build SDL_mixer from scratch.</i><strong>&quot;</strong></p>
  <p><i>Thank you for taking your time to read this.</i></p>