Secretchronicles / TSC

An open source two-dimensional platform game.
https://secretchronicles.org/
GNU General Public License v3.0
205 stars 49 forks source link

Stack audio errors when building TSC on MSYS2 on Windows #674

Closed xet7 closed 4 years ago

xet7 commented 4 years ago

2019-12-17 both branches devel and release-2.1.0 have this error:

[ 16%] Building CXX object CMakeFiles/tsc.dir/src/audio/sound_manager.cpp.obj
[ 16%] Building CXX object CMakeFiles/tsc.dir/src/audio/random_sound.cpp.obj
[ 16%] Building CXX object CMakeFiles/tsc.dir/src/campaign/campaign_loader.cpp.obj
In file included from C:/msys64/home/vagrant/TSC/tsc/src/audio/random_sound.cpp:20:
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.hpp:203:14: error: 'stack' in namespace 'std' does not name a template type
  203 |         std::stack<NextMusicInfo> m_next_music;
      |              ^~~~~
In file included from C:/msys64/home/vagrant/TSC/tsc/src/audio/random_sound.cpp:20:
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.hpp:27:1: note: 'std::stack' is defined in header '<stack>'; did you forget to '#include <stack>'?
   26 | #include <queue>
  +++ |+#include <stack>
   27 | #ifdef _WIN32
In file included from C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.cpp:17:
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.hpp:203:14: error: 'stack' in namespace 'std' does not name a template type
  203 |         std::stack<NextMusicInfo> m_next_music;
      |              ^~~~~
In file included from C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.cpp:17:
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.hpp:27:1: note: 'std::stack' is defined in header '<stack>'; did you forget to '#include <stack>'?
   26 | #include <queue>
  +++ |+#include <stack>
   27 | #ifdef _WIN32
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.cpp: In member function 'bool TSC::cAudio::Play_Music(boost::filesystem::path, bool, bool, unsigned int)':
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.cpp:351:9: error: 'm_next_music' was not declared in this scope
  351 |         m_next_music.emplace(filename, loops, fadein_ms);
      |         ^~~~~~~~~~~~
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.cpp: In member function 'void TSC::cAudio::Update()':
C:/msys64/home/vagrant/TSC/tsc/src/audio/audio.cpp:570:33: error: 'm_next_music' was not declared in this scope
  570 |     if (!Is_Music_Playing() && !m_next_music.empty()) {
      |                                 ^~~~~~~~~~~~
make[2]: *** [CMakeFiles/tsc.dir/build.make:76: CMakeFiles/tsc.dir/src/audio/random_sound.cpp.obj] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/tsc.dir/build.make:63: CMakeFiles/tsc.dir/src/audio/audio.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:236: CMakeFiles/tsc.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Quintus commented 4 years ago

I've added a fix. Please retry compiling the release-2.1.0 branch.

xet7 commented 4 years ago

Thanks! Now it works!