# MSYS2 compilation sound library problems

**URL:** https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688
**Category:** The Garage
**Created:** [April 11, 2016, 5:10am UTC](https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688 "2016-04-11T05:10:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Salganos](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Salganos](https://discourse.cataclysmdda.org/u/Salganos)
#### Post date: [April 11, 2016, 5:10am UTC](https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688/1 "2016-04-11T05:10:40Z")

</div>

I’m attempting to set up a compilation pipeline for this game, and have so far had the most success with MSYS2, but there are issues with the sound library inclusion.

With SOUND=1 or SOUND=0:

```auto
/bin/sh: astyle: command not found
#define VERSION "0.C-12789-g26a3dfe"
Cannot run an astyle check, your system either does not have astyle, or it is too old.
tools/json_format_check.sh
g++ -DRELEASE -DGIT_VERSION -DTILES -DLOCALIZE -ffast-math -Os -Wall -Wextra -Werror --std=c++11 -MMD -m64 -IC:/msys64/mingw64/include/SDL2 -DSDL_SOUND -IC:/msys64/mingw64/include -DLUA -I/mingw64/include/SDL2 -IC:/msys64/mingw64/include/SDL2 -IC:/msys64/mingw64/include/SDL2 -c src/version.cpp -o objwin/tiles/version.o
g++ -Wl,-stack,12000000,-subsystem,windows -o cataclysm-tiles.exe ...things.o... -s -m64 -static -lintl -liconv -LC:/msys64/mingw64/lib -lSDL2_mixer -lmingw32 -lSDL2 -lpthread -lmad -LC:/msys64/mingw64/lib -llua -lm -L/mingw64/lib -lmingw32 -lSDL2 -mwindows -lSDL2_ttf -lSDL2_image -lfreetype -lpng -lz -ltiff -lbz2 -lharfbuzz -lglib-2.0 -llzma -lws2_32 -lintl -liconv -lwebp -ljpeg -luuid -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0xd): undefined reference to `__imp_ModPlug_Load'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x1b): undefined reference to `__imp_ModPlug_Unload'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x29): undefined reference to `__imp_ModPlug_Read'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x37): undefined reference to `__imp_ModPlug_Seek'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x45): undefined reference to `__imp_ModPlug_GetSettings'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x53): undefined reference to `__imp_ModPlug_SetSettings'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x61): undefined reference to `__imp_ModPlug_SetMasterVolume'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x11): undefined reference to `__imp_delete_fluid_player'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x1f): undefined reference to `__imp_delete_fluid_settings'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x2d): undefined reference to `__imp_delete_fluid_synth'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x3b): undefined reference to `__imp_fluid_player_add'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x49): undefined reference to `__imp_fluid_player_add_mem'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x57): undefined reference to `__imp_fluid_player_get_status'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x65): undefined reference to `__imp_fluid_player_play'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x73): undefined reference to `__imp_fluid_player_set_loop'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x81): undefined reference to `__imp_fluid_player_stop'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x8f): undefined reference to `__imp_fluid_settings_setnum'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x9d): undefined reference to `__imp_fluid_synth_get_settings'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xab): undefined reference to `__imp_fluid_synth_set_gain'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xb9): undefined reference to `__imp_fluid_synth_sfload'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xc7): undefined reference to `__imp_fluid_synth_write_s16'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xd5): undefined reference to `__imp_new_fluid_player'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xe3): undefined reference to `__imp_new_fluid_settings'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xf1): undefined reference to `__imp_new_fluid_synth'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_time_seek[.refptr.ov_time_seek]+0x0): undefined reference to `ov_time_seek'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_read[.refptr.ov_read]+0x0): undefined reference to `ov_read'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_pcm_total[.refptr.ov_pcm_total]+0x0): undefined reference to `ov_pcm_total'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_open_callbacks[.refptr.ov_open_callbacks]+0x0): undefined reference to `ov_open_callbacks'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_info[.refptr.ov_info]+0x0): undefined reference to `ov_info'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_clear[.refptr.ov_clear]+0x0): undefined reference to `ov_clear'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_get_state[.refptr.FLAC__stream_decoder_get_state]+0x0): undefined reference to `FLAC__stream_decoder_get_state'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_seek_absolute[.refptr.FLAC__stream_decoder_seek_absolute]+0x0): undefined reference to `FLAC__stream_decoder_seek_absolute'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_process_until_end_of_stream[.refptr.FLAC__stream_decoder_process_until_end_of_stream]+0x0): undefined reference to `FLAC__stream_decoder_process_until_end_of_stream'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_process_until_end_of_metadata[.refptr.FLAC__stream_decoder_process_until_end_of_metadata]+0x0): undefined reference to `FLAC__stream_decoder_process_until_end_of_metadata'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_process_single[.refptr.FLAC__stream_decoder_process_single]+0x0): undefined reference to `FLAC__stream_decoder_process_single'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_flush[.refptr.FLAC__stream_decoder_flush]+0x0): undefined reference to `FLAC__stream_decoder_flush'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_finish[.refptr.FLAC__stream_decoder_finish]+0x0): undefined reference to `FLAC__stream_decoder_finish'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_init_stream[.refptr.FLAC__stream_decoder_init_stream]+0x0): undefined reference to `FLAC__stream_decoder_init_stream'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_delete[.refptr.FLAC__stream_decoder_delete]+0x0): undefined reference to `FLAC__stream_decoder_delete'
C:/msys64/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__stream_decoder_new[.refptr.FLAC__stream_decoder_new]+0x0): undefined reference to `FLAC__stream_decoder_new'
collect2.exe: error: ld returned 1 exit status
Makefile:559: recipe for target 'cataclysm-tiles.exe' failed
make: *** [cataclysm-tiles.exe] Error 1
```

Without SOUND:

```auto
/bin/sh: astyle: command not found
Cannot run an astyle check, your system either does not have astyle, or it is too old.
tools/json_format_check.sh
g++ -Wl,-stack,12000000,-subsystem,windows -o cataclysm-tiles.exe ...things.o... -s -m64 -static -lintl -liconv -LC:/msys64/mingw64/lib -llua -lm -L/mingw64/lib -lmingw32 -lSDL2 -mwindows -lSDL2_ttf -lSDL2_image -lfreetype -lpng -lz -ltiff -lbz2 -lharfbuzz -lglib-2.0 -llzma -lws2_32 -lintl -liconv -lwebp -ljpeg -luuid -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion
objwin/tiles/sounds.o:sounds.cpp:(.text+0x467): undefined reference to `Mix_Playing'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x47b): undefined reference to `Mix_FadeOutChannel'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x55e): undefined reference to `Mix_FadeOutChannel'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x579): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x5f6): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x669): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x6c1): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x774): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x7e1): more undefined references to `Mix_FadeOutGroup' follow
objwin/tiles/sounds.o:sounds.cpp:(.text+0x1092): undefined reference to `Mix_FadeOutChannel'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x11d2): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x127c): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x12d1): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x12e0): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x135f): undefined reference to `Mix_FadeOutGroup'
objwin/tiles/sounds.o:sounds.cpp:(.text+0x136e): more undefined references to `Mix_FadeOutGroup' follow
objwin/tiles/sounds.o:sounds.cpp:(.text+0x45e): undefined reference to `Mix_FadeOutChannel'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x237): undefined reference to `Mix_GetChunk'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x2d36): undefined reference to `Mix_CloseAudio'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x2fea): undefined reference to `Mix_LoadMUS'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x30ac): undefined reference to `Mix_VolumeMusic'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x30c2): undefined reference to `Mix_PlayMusic'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x315d): undefined reference to `Mix_HookMusicFinished'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x31b2): undefined reference to `Mix_HaltMusic'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x31be): undefined reference to `Mix_FreeMusic'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x34cb): undefined reference to `Mix_VolumeChunk'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x34e5): undefined reference to `Mix_PlayChannelTimed'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x3543): undefined reference to `Mix_ChannelFinished'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x35bc): undefined reference to `Mix_VolumeChunk'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x35d6): undefined reference to `Mix_PlayChannelTimed'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x35e6): undefined reference to `Mix_SetPosition'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x3687): undefined reference to `Mix_VolumeChunk'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x36ad): undefined reference to `Mix_FadeInChannelTimed'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x4cde): undefined reference to `Mix_LoadWAV_RW'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x4cf2): undefined reference to `Mix_FreeChunk'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5da1): undefined reference to `Mix_OpenAudio'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5daf): undefined reference to `Mix_AllocateChannels'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5e28): undefined reference to `Mix_ReserveChannels'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5e3d): undefined reference to `Mix_GroupChannels'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5e4f): undefined reference to `Mix_GroupChannels'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5e64): undefined reference to `Mix_GroupChannels'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0x5e79): undefined reference to `Mix_GroupChannels'
objwin/tiles/sdltiles.o:sdltiles.cpp:(.text+0xf3): undefined reference to `Mix_FreeChunk'
collect2.exe: error: ld returned 1 exit status
Makefile:559: recipe for target 'cataclysm-tiles.exe' failed
make: *** [cataclysm-tiles.exe] Error 1
```

I’ve attempted to include more libraries, as indicated in [http://smf.cataclysmdda.com/index.php?topic=11010.0](http://smf.cataclysmdda.com/index.php?topic=11010.0), but this has been insufficient, and I do not know the correct library names to include, nor do I know why sound libraries are even being included when I very much do not need or want it.

---

<div class="post-metadata">

### Author: ![Salganos](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Salganos](https://discourse.cataclysmdda.org/u/Salganos)
#### Post date: [April 11, 2016, 5:21am UTC](https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688/2 "2016-04-11T05:21:04Z")

</div>

Poking about the CodeBlocks project file for libraries led me to try adding -lSDL2\_mixer to the inclusions. This has resulted in a helpful message:

```auto
$ make MSYS2=1 RELEASE=1 TILES=1 LOCALIZE=1 SOUND=1 LUA=1 NATIVE=win64
/bin/sh: astyle: command not found
#define VERSION "0.C-12789-g26a3dfe-dirty"
Cannot run an astyle check, your system either does not have astyle, or it is too old.
tools/json_format_check.sh
g++ -DRELEASE -DGIT_VERSION -DTILES -DLOCALIZE -ffast-math -Os -Wall -Wextra -Werror --std=c++11 -MMD -m64 -IC:/msys64/mingw64/include/SDL2 -DSDL_SOUND -IC:/msys64/mingw64/include -DLUA -I/mingw64/include/SDL2 -IC:/msys64/mingw64/include/SDL2 -IC:/msys64/mingw64/include/SDL2 -c src/version.cpp -o objwin/tiles/version.o
g++ -Wl,-stack,12000000,-subsystem,windows -o cataclysm-tiles.exe objwin/tiles/overmap.o objwin/tiles/mission_fail.o objwin/tiles/submap.o objwin/tiles/mod_manager_ui.o objwin/tiles/cata_utility.o objwin/tiles/monfaction.o objwin/tiles/main_menu.o objwin/tiles/iexamine.o objwin/tiles/mutation_data.o objwin/tiles/mission_end.o objwin/tiles/color.o objwin/tiles/input.o objwin/tiles/addiction.o objwin/tiles/action.o objwin/tiles/messages.o objwin/tiles/computer.o objwin/tiles/mission_start.o objwin/tiles/gamemode.o objwin/tiles/sounds.o objwin/tiles/tileray.o objwin/tiles/weather_data.o objwin/tiles/ui.o objwin/tiles/faction.o objwin/tiles/posix_time.o objwin/tiles/coordinate_conversions.o objwin/tiles/mapgen.o objwin/tiles/monattack.o objwin/tiles/catalua.o objwin/tiles/editmap.o objwin/tiles/mondeath.o objwin/tiles/mapgenformat.o objwin/tiles/iuse.o objwin/tiles/help.o objwin/tiles/iuse_software_kitten.o objwin/tiles/player_activity.o objwin/tiles/dependency_tree.o objwin/tiles/cata_tiles.o objwin/tiles/scenario.o objwin/tiles/bionics.o objwin/tiles/artifact.o objwin/tiles/npcmove.o objwin/tiles/crafting_gui.o objwin/tiles/vehicle_selector.o objwin/tiles/name.o objwin/tiles/monmove.o objwin/tiles/event.o objwin/tiles/basecamp.o objwin/tiles/line.o objwin/tiles/init.o objwin/tiles/char_validity_check.o objwin/tiles/sdltiles.o objwin/tiles/requirements.o objwin/tiles/armor_layers.o objwin/tiles/savegame_legacy.o objwin/tiles/ammo.o objwin/tiles/monster.o objwin/tiles/lua_console.o objwin/tiles/activity_item_handling.o objwin/tiles/drawing_primitives.o objwin/tiles/construction.o objwin/tiles/veh_interact.o objwin/tiles/iuse_software_minesweeper.o objwin/tiles/iuse_actor.o objwin/tiles/options.o objwin/tiles/mission.o objwin/tiles/animation.o objwin/tiles/mongroup.o objwin/tiles/iuse_software.o objwin/tiles/rng.o objwin/tiles/output.o objwin/tiles/damage.o objwin/tiles/npctalk.o objwin/tiles/start_location.o objwin/tiles/ranged.o objwin/tiles/trap.o objwin/tiles/mission_companion.o objwin/tiles/map_selector.o objwin/tiles/mapsharing.o objwin/tiles/trapfunc.o objwin/tiles/mondefense.o objwin/tiles/lightmap.o objwin/tiles/inventory.o objwin/tiles/json.o objwin/tiles/activity_handlers.o objwin/tiles/item_location.o objwin/tiles/debug.o objwin/tiles/tutorial.o objwin/tiles/game.o objwin/tiles/calendar.o objwin/tiles/newcharacter.o objwin/tiles/mission_place.o objwin/tiles/missiondef.o objwin/tiles/character.o objwin/tiles/recipe_dictionary.o objwin/tiles/mod_manager.o objwin/tiles/advanced_inv.o objwin/tiles/explosion.o objwin/tiles/mapgen_functions.o objwin/tiles/overmapbuffer.o objwin/tiles/melee.o objwin/tiles/craft_command.o objwin/tiles/visitable.o objwin/tiles/material.o objwin/tiles/field.o objwin/tiles/mutation.o objwin/tiles/npc.o objwin/tiles/text_snippets.o objwin/tiles/vehicle_group.o objwin/tiles/mapdata.o objwin/tiles/player.o objwin/tiles/active_item_cache.o objwin/tiles/crafting.o objwin/tiles/morale.o objwin/tiles/savegame_json.o objwin/tiles/iuse_software_snake.o objwin/tiles/wish.o objwin/tiles/wincurse.o objwin/tiles/weather.o objwin/tiles/mapbuffer.o objwin/tiles/defense.o objwin/tiles/profession.o objwin/tiles/catacharset.o objwin/tiles/version.o objwin/tiles/live_view.o objwin/tiles/iuse_software_sokoban.o objwin/tiles/path_info.o objwin/tiles/translations.o objwin/tiles/creature_tracker.o objwin/tiles/item_group.o objwin/tiles/gates.o objwin/tiles/item_action.o objwin/tiles/vehicle.o objwin/tiles/speech.o objwin/tiles/item_factory.o objwin/tiles/veh_type.o objwin/tiles/simplexnoise.o objwin/tiles/monstergenerator.o objwin/tiles/pathfinding.o objwin/tiles/weather_gen.o objwin/tiles/inventory_ui.o objwin/tiles/mattack_actors.o objwin/tiles/savegame.o objwin/tiles/effect.o objwin/tiles/overlay_ordering.o objwin/tiles/skill.o objwin/tiles/clzones.o objwin/tiles/main.o objwin/tiles/cursesport.o objwin/tiles/auto_pickup.o objwin/tiles/bodypart.o objwin/tiles/worldfactory.o objwin/tiles/itype.o objwin/tiles/item.o objwin/tiles/filesystem.o objwin/tiles/map.o objwin/tiles/pickup.o objwin/tiles/bonuses.o objwin/tiles/creature.o objwin/tiles/consumption.o objwin/tiles/martialarts.o objwin/tiles/mtype.o objwin/tiles/resource.o -s -m64 -static -lintl -liconv -LC:/msys64/mingw64/lib -lSDL2_mixer -lmingw32 -lSDL2 -lpthread -lmad -lSDL2_mixer -LC:/msys64/mingw64/lib -llua -lm -L/mingw64/lib -lmingw32 -lSDL2 -mwindows -lSDL2_ttf -lSDL2_image -lfreetype -lpng -lz -ltiff -lbz2 -lharfbuzz -lglib-2.0 -llzma -lws2_32 -lintl -liconv -lwebp -ljpeg -luuid -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: reopening cataclysm-tiles.exe: Permission denied

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Permission denied
collect2.exe: error: ld returned 1 exit status
Makefile:559: recipe for target 'cataclysm-tiles.exe' failed
make: *** [cataclysm-tiles.exe] Error 1
```

where by helpful I mean exactly the opposite.

EDIT: Unhelpful message has not recurred. Initial problem stands. -lSDL2\_mixer was also apparently already included.

---

<div class="post-metadata">

### Author: ![Salganos](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Salganos](https://discourse.cataclysmdda.org/u/Salganos)
#### Post date: [April 11, 2016, 5:38am UTC](https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688/3 "2016-04-11T05:38:22Z")

</div>

Further notes:

Adding -lflac removes the FLAC errors, but adding -logg -lfluidsynth -lmodplug does not remove the ogg, fluidsynth, and modplug errors, despite apparently being valid libraries. None of this has any effect on the errors present without SOUND.

---

<div class="post-metadata">

### Author: ![Salganos](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Salganos](https://discourse.cataclysmdda.org/u/Salganos)
#### Post date: [April 11, 2016, 2:16pm UTC](https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688/4 "2016-04-11T14:16:58Z")

</div>

Compiles properly with the TILES and SOUND options removed. Would like to be able to compile with tiles, still.

---

<div class="post-metadata">

### Author: ![rremyroy](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rremyroy](https://discourse.cataclysmdda.org/u/rremyroy)
#### Post date: [April 11, 2016, 5:36pm UTC](https://discourse.cataclysmdda.org/t/msys2-compilation-sound-library-problems/11688/5 "2016-04-11T17:36:15Z")

</div>

Check out this thread: [https://github.com/CleverRaven/Cataclysm-DDA/issues/15568](https://github.com/CleverRaven/Cataclysm-DDA/issues/15568) . I believe it should answer most of your questions.
