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.
But seems that the two example projects playmus and playwave return errors (17 in total for each) regarding unresolved external symbols regarding FLAC(Free Lossless Audio Codec) and modplug.
Seems that I have properly linked them by adding modplug.lib
and libFLAC_static.lib
in the additional linker dependencies column for both the example projects.
I have been trying to solve this problem because it is obvious that if these two example projects fail, then my project using SDL2_mixer will also fail with these unresolved external symbol errors.
And in the end, I was right. It happened... when I used it.
So gracefully, is there a way to get rid of these linker errors (seems that I have properly linked them though).
The errors are here (if you please):
Error LNK2019: unresolved external symbol __imp__ModPlug_Load referenced in function _MODPLUG_Load
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_process_until_end_of_stream referenced in function _FLAC_Load
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_process_until_end_of_metadata referenced in function _FLAC_Load
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_process_single referenced in function _FLAC_Load
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_flush referenced in function _FLAC_Load
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_finish referenced in function _FLAC_Load
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_init_stream referenced in function _FLAC_Load
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
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_new referenced in function _FLAC_Load
Error LNK2019: unresolved external symbol __imp__ModPlug_SetMasterVolume referenced in function _MODPLUG_Load
Error LNK2019: unresolved external symbol __imp__ModPlug_SetSettings referenced in function _MODPLUG_Load
Error LNK2019: unresolved external symbol __imp__ModPlug_GetSettings referenced in function _MODPLUG_Load
Error LNK2019: unresolved external symbol __imp__ModPlug_Seek referenced in function _MODPLUG_Load
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
Error LNK2019: unresolved external symbol __imp__FLAC__stream_decoder_seek_absolute referenced in function _FLAC_Load
Error LNK1120: 17 unresolved externals
Additional Dependencies: (which I added while trying to solve these errors helplessly):-
winmm.lib
version.lib
libmpg123-0.lib
modplug.lib
libFLAC_static.lib
Preprocessor Settings: (Inside SDL2_mixer project):- (I suspect this might have something to do with this error but still looks all too well):-
MUSIC_WAV
MUSIC_MOD_MODPLUG
MUSIC_OGG
MUSIC_FLAC
MUSIC_MP3_MPG123
MUSIC_MID_TIMIDITY
MUSIC_MID_NATIVE
The errors are almost the same for both the projects.
I grabbed modplug on GitHub from here, so it is not official.
"And believe me, it is always a pain to build SDL_mixer from scratch."
Thank you for taking your time to read this.