Question about compiling

On Windows 7 Pro x64:

C:/msys64/mingw64/lib\libSDL2.a(SDL_render_d3d11.o):(.rdata$.refptr.IID_IDXGIDevice1[.refptr.IID_IDXGIDevice1]+0x0): undefined reference to IID_IDXGIDevice1' C:/msys64/mingw64/lib\libSDL2.a(SDL_render_d3d11.o):(.rdata$.refptr.IID_ID3D11DeviceContext1[.refptr.IID_ID3D11DeviceContext1]+0x0): undefined reference toIID_ID3D11DeviceContext1’
C:/msys64/mingw64/lib\libSDL2.a(SDL_render_d3d11.o):(.rdata$.refptr.IID_ID3D11Device1[.refptr.IID_ID3D11Device1]+0x0): undefined reference to IID_ID3D11Device1' C:/msys64/mingw64/lib\libSDL2.a(SDL_render_d3d11.o):(.rdata$.refptr.IID_IDXGIFactory2[.refptr.IID_IDXGIFactory2]+0x0): undefined reference toIID_IDXGIFactory2’
C:/msys64/mingw64/lib\libSDL2.a(SDL_render_d3d11.o):(.rdata$.refptr.IID_ID3D11Texture2D[.refptr.IID_ID3D11Texture2D]+0x0): undefined reference to `IID_ID3D11Texture2D’
collect2.exe: error: ld returned 1 exit status
Makefile:455: recipe for target ‘cataclysm-tiles.exe’ failed
make: *** [cataclysm-tiles.exe] Error 1

Solution: add -luuid to to the libs.


https://etherpad.mozilla.org/QsktItkkSE
I saw this page and do that.
Then, I encounter same problem that was recorded in the page.
Its solution is 'add -luuid to to the libs.'
what’s that mean??? I can’t understand this sentence

If it’s the makefile, one of those "LDFLAGS += " lines needs to have -luuid added to the end of it. It would probably look like “LDFLAGS += -lSDL2_ttf -lSDL2_image -luuid” around line 338. SDL on Windows is expecting a library libuuid.a in the MinGW lib folder to be included.

Thx You’re awesome :slight_smile:

Could I ask you a question?
When I try to compile new experimental version of cataclysm, this error occurred
How do I solve this error?

g++ -DRELEASE -DSDLTILES -DTILES -DLOCALIZE -ffast-math -Wall -Wextra -Werror - -std=c++11 -MMD -m64 -IE:/Game/msys2/mingw64/include/SDL2 -DSDL_SOUND -DLUA -I/m ingw64/include/SDL2 -c src/sounds.cpp -o objwin/tiles/sounds.o In file included from src/sounds.cpp:25:0: src/mingw.thread.h:24:7: error: redefinition of 'class std::thread' class thread ^ In file included from src/sounds.cpp:23:0: E:/Game/msys2/mingw64/include/c++/5.2.0/thread:60:9: error: previous definition of 'class std::thread' class thread ^ In file included from src/sounds.cpp:25:0: src/mingw.thread.h: In function 'std::thread::id std::this_thread::get_id()': src/mingw.thread.h:109:23: error: redefinition of 'std::thread::id std::this_thr ead::get_id()' inline thread::id get_id() {return thread::id(GetCurrentThreadId());} ^ In file included from src/sounds.cpp:23:0: E:/Game/msys2/mingw64/include/c++/5.2.0/thread:263:5: note: 'std::thread::id std ::this_thread::get_id()' previously defined here get_id() noexcept { return thread::id(__gthread_self()); } ^ In file included from src/sounds.cpp:25:0: src/mingw.thread.h: In function 'void std::this_thread::yield()': src/mingw.thread.h:110:17: error: redefinition of 'void std::this_thread::yield( )' inline void yield() {Sleep(0);} ^ In file included from src/sounds.cpp:23:0: E:/Game/msys2/mingw64/include/c++/5.2.0/thread:267:5: note: 'void std::this_thre ad::yield()' previously defined here yield() noexcept ^ In file included from src/sounds.cpp:25:0: src/mingw.thread.h: At global scope: src/mingw.thread.h:112:10: error: redefinition of 'template<class Rep, class Per iod> void std::this_thread::sleep_for(const std::chrono::duration<_Rep1, _Period 1>&)' void sleep_for( const std::chrono::duration<Rep,Period>& sleep_duration) ^ In file included from src/sounds.cpp:23:0: E:/Game/msys2/mingw64/include/c++/5.2.0/thread:280:7: note: 'template<class _Rep , class _Period> void std::this_thread::sleep_for(const std::chrono::duration<_R ep1, _Period1>&)' previously declared here sleep_for(const chrono::duration<_Rep, _Period>& __rtime) ^ In file included from src/sounds.cpp:25:0: src/mingw.thread.h:117:10: error: redefinition of 'template<class Clock, class D uration> void std::this_thread::sleep_until(const std::chrono::time_point<_Clock , _Duration1>&)' void sleep_until(const std::chrono::time_point<Clock,Duration>& sleep_time) ^ In file included from src/sounds.cpp:23:0: E:/Game/msys2/mingw64/include/c++/5.2.0/thread:301:7: note: 'template<class _Clo ck, class _Duration> void std::this_thread::sleep_until(const std::chrono::time_ point<_Clock, _Duration1>&)' previously declared here sleep_until(const chrono::time_point<_Clock, _Duration>& __atime) ^ Makefile:477: 'objwin/tiles/sounds.o' 타겟에 대한 명령이 실패했습니다 make: *** [objwin/tiles/sounds.o] 오류 1

I think mingw.thread.h was written for older versions of MinGW, since you have 5.2.0 apparently, you should be able to comment out the include “mingw.thread.h” around lines 24-26 in sounds.cpp to make it work.

:slight_smile: thank you so much
your advice was a really big help.
unfortunately, I got another problem… :frowning:

E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0xd): undefi ned reference to `__imp_ModPlug_Load' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x1b): undef ined reference to `__imp_ModPlug_Unload' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x29): undef ined reference to `__imp_ModPlug_Read' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x37): undef ined reference to `__imp_ModPlug_Seek' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x45): undef ined reference to `__imp_ModPlug_GetSettings' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x53): undef ined reference to `__imp_ModPlug_SetSettings' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_modplug.o):(.text+0x61): undef ined reference to `__imp_ModPlug_SetMasterVolume' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x11): un defined reference to `__imp_delete_fluid_player' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x1f): un defined reference to `__imp_delete_fluid_settings' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x2d): un defined reference to `__imp_delete_fluid_synth' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x3b): un defined reference to `__imp_fluid_player_add' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x49): un defined reference to `__imp_fluid_player_add_mem' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x57): un defined reference to `__imp_fluid_player_get_status' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x65): un defined reference to `__imp_fluid_player_play' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x73): un defined reference to `__imp_fluid_player_set_loop' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x81): un defined reference to `__imp_fluid_player_stop' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x8f): un defined reference to `__imp_fluid_settings_setnum' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0x9d): un defined reference to `__imp_fluid_synth_get_settings' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xab): un defined reference to `__imp_fluid_synth_set_gain' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xb9): un defined reference to `__imp_fluid_synth_sfload' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xc7): un defined reference to `__imp_fluid_synth_write_s16' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xd5): un defined reference to `__imp_new_fluid_player' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xe3): un defined reference to `__imp_new_fluid_settings' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_fluidsynth.o):(.text+0xf1): un defined reference to `__imp_new_fluid_synth' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_time _seek[.refptr.ov_time_seek]+0x0): undefined reference to `ov_time_seek' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_read [.refptr.ov_read]+0x0): undefined reference to `ov_read' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_pcm_ total[.refptr.ov_pcm_total]+0x0): undefined reference to `ov_pcm_total' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_open _callbacks[.refptr.ov_open_callbacks]+0x0): undefined reference to `ov_open_call backs' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_info [.refptr.ov_info]+0x0): undefined reference to `ov_info' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_ogg.o):(.rdata$.refptr.ov_clea r[.refptr.ov_clear]+0x0): undefined reference to `ov_clear' E:/Game/msys2/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' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_seek_absolute[.refptr.FLAC__stream_decoder_seek_absolute]+0x0): u ndefined reference to `FLAC__stream_decoder_seek_absolute' E:/Game/msys2/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' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_process_until_end_of_metadata[.refptr.FLAC__stream_decoder_proces s_until_end_of_metadata]+0x0): undefined reference to `FLAC__stream_decoder_proc ess_until_end_of_metadata' E:/Game/msys2/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' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_flush[.refptr.FLAC__stream_decoder_flush]+0x0): undefined referen ce to `FLAC__stream_decoder_flush' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_finish[.refptr.FLAC__stream_decoder_finish]+0x0): undefined refer ence to `FLAC__stream_decoder_finish' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_init_stream[.refptr.FLAC__stream_decoder_init_stream]+0x0): undef ined reference to `FLAC__stream_decoder_init_stream' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_delete[.refptr.FLAC__stream_decoder_delete]+0x0): undefined refer ence to `FLAC__stream_decoder_delete' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_flac.o):(.rdata$.refptr.FLAC__ stream_decoder_new[.refptr.FLAC__stream_decoder_new]+0x0): undefined reference t o `FLAC__stream_decoder_new' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_s top[.refptr.SMPEG_stop]+0x0): undefined reference to `SMPEG_stop' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_s tatus[.refptr.SMPEG_status]+0x0): undefined reference to `SMPEG_status' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_s kip[.refptr.SMPEG_skip]+0x0): undefined reference to `SMPEG_skip' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_s etvolume[.refptr.SMPEG_setvolume]+0x0): undefined reference to `SMPEG_setvolume' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_r ewind[.refptr.SMPEG_rewind]+0x0): undefined reference to `SMPEG_rewind' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_p layAudio[.refptr.SMPEG_playAudio]+0x0): undefined reference to `SMPEG_playAudio' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_p lay[.refptr.SMPEG_play]+0x0): undefined reference to `SMPEG_play' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_n ew_rwops[.refptr.SMPEG_new_rwops]+0x0): undefined reference to `SMPEG_new_rwops' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_e nablevideo[.refptr.SMPEG_enablevideo]+0x0): undefined reference to `SMPEG_enable video' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_e nableaudio[.refptr.SMPEG_enableaudio]+0x0): undefined reference to `SMPEG_enable audio' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_d elete[.refptr.SMPEG_delete]+0x0): undefined reference to `SMPEG_delete' E:/Game/msys2/mingw64/lib\libSDL2_mixer.a(dynamic_mp3.o):(.rdata$.refptr.SMPEG_a ctualSpec[.refptr.SMPEG_actualSpec]+0x0): undefined reference to `SMPEG_actualSp ec' collect2.exe: error: ld returned 1 exit status Makefile:455: 'cataclysm-tiles.exe' 타겟에 대한 명령이 실패했습니다 make: *** [cataclysm-tiles.exe] 오류 1

According to https://www.libsdl.org/projects/SDL_mixer/, you should have flac, libmikmod, libogg, libvorbis, and smpeg libraries somewhere on the MSYS2 system. You can modify the LDFLAGS thing again to add -lflac -lmikmod -logg -lvorbis -lsmpeg if those are the correct names. They may have been downloaded when you got SDL2 mixer, but they are not automatically added to the library search.

thx I’ll try to that

We should work around this automatically, thanks for reporting.

Finally, I completed compilation.

However, problems remain…
Sound effect(menu selection) was working properly.
By contrast, any music can’t play in cataclysm.(add wav, mp3, ogg … of course, i edit json file)

I hope it will be my last challenge :frowning:

However, problems remain... Sound effect(menu selection) was working properly. By contrast, any music can't play in cataclysm.(add wav, mp3, ogg .. of course, i edit json file)

Because you didn’t provide any more details, I have to ask:

The sound card is properly installed and other programs can produce sound?
Have you checked the volume (in-game setting and of the sound card)?
Can those audio files be played in other programs?

Most importantly: what does config/debug.log contain? And what exactly did you edit in which JSON file.

I’m guessing the extra sound libraries could be dynamically linked for SDL2 from seeing the “dynamic_modplug.o” in your earlier logs, you may need to copy related DLLs that are in your MSYS2 installation to the folder where you built your Cataclysm.exe. There could be filenames like mikmod.dll, ogg.dll in a “bin” folder near where the library files were installed.