sirjuddington / SLADE

It's a Doom editor
https://slade.mancubus.net
GNU General Public License v2.0
710 stars 109 forks source link

Unable to build, errors about music #1721

Closed c0des1ayr closed 2 months ago

c0des1ayr commented 2 months ago

SLADE Version

e745dc0f59fd53f1c8c252a36855ea4ee5816128 (Uncompiled)

OS

Linux

Issue Details

On Kali, I tried to compile SLADE, but it always seems to throw an error about "invalid use of incomplete type ‘class slade::audio::Music’", see the following log:

PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In constructor ‘slade::AudioEntryPanel::AudioEntryPanel(wxWindow*)’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:73:34: error: invalid use of incomplete type ‘class slade::audio::Music’
   73 |         music_{ new audio::Music() },
      |                                  ^
In file included from PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:33:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:73:9: error: no matching function for call to ‘std::unique_ptr<slade::audio::Music>::unique_ptr(<brace-enclosed initializer list>)’
   73 |         music_{ new audio::Music() },
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/memory:78,
                 from PATH_TO_CLONED_REPO/slade/src/../thirdparty/sigslot/signal.hpp:3,
                 from PATH_TO_CLONED_REPO/slade/src/common.h:135,
                 from PATH_TO_CLONED_REPO/slade/dist/src/cotire/slade_CXX_prefix.cxx:4,
                 from PATH_TO_CLONED_REPO/slade/dist/src/cotire/slade_CXX_prefix.hxx:4:
/usr/include/c++/14/bits/unique_ptr.h:384:9: note: candidate: ‘template<class _Up, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(std::auto_ptr<_Up>&&) [with <template-parameter-2-2> = _Up; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  384 |         unique_ptr(auto_ptr<_Up>&& __u) noexcept;
      |         ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:384:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:374:9: note: candidate: ‘template<class _Up, class _Ep, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Ep = _Up; <template-parameter-2-3> = _Ep; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  374 |         unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
      |         ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:374:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:353:19: note: candidate: ‘template<class _Del, class> constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr(std::nullptr_t) [with <template-parameter-2-2> = _Del; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  353 |         constexpr unique_ptr(nullptr_t) noexcept
      |                   ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:353:19: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:347:9: note: candidate: ‘template<class _Del, class _DelUnref> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer, std::__enable_if_t<((bool)std::is_lvalue_reference<_Ht>::value), _DelUnref&&>) [with _DelUnref = _Del; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’ (deleted)
  347 |         unique_ptr(pointer,
      |         ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:347:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/unique_ptr.h:338:9: note: candidate: ‘template<class _Del, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer, std::__enable_if_t<((bool)(! std::is_lvalue_reference<_Ht>::value)), _Del&&>) [with <template-parameter-2-2> = _Del; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  338 |         unique_ptr(pointer __p,
      |         ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:338:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/unique_ptr.h:325:9: note: candidate: ‘template<class _Del, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer, const deleter_type&) [with <template-parameter-2-2> = _Del; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  325 |         unique_ptr(pointer __p, const deleter_type& __d) noexcept
      |         ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:325:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/unique_ptr.h:311:9: note: candidate: ‘template<class _Del, class> std::unique_ptr<_Tp, _Dp>::unique_ptr(pointer) [with <template-parameter-2-2> = _Del; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  311 |         unique_ptr(pointer __p) noexcept
      |         ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:311:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/unique_ptr.h:298:19: note: candidate: ‘template<class _Del, class> constexpr std::unique_ptr<_Tp, _Dp>::unique_ptr() [with <template-parameter-2-2> = _Del; _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  298 |         constexpr unique_ptr() noexcept
      |                   ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:298:19: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/unique_ptr.h:360:7: note: candidate: ‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  360 |       unique_ptr(unique_ptr&&) = default;
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:360:7: note:   conversion of argument 1 would be ill-formed:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:135:15: error: invalid use of incomplete type ‘class slade::audio::Music’
  135 |         music_->setVolume(snd_volume);
      |               ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘bool slade::AudioEntryPanel::open(slade::ArchiveEntry*)’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:263:15: error: invalid use of incomplete type ‘class slade::audio::Music’
  263 |         music_->allowSeek(false); // Needed to avoid a crash in SFML with ogg files
      |               ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:346:15: error: invalid use of incomplete type ‘class slade::audio::Music’
  346 |         music_->allowSeek(true);
      |               ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘bool slade::AudioEntryPanel::openAudio(slade::MemChunk&, const wxString&)’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:385:24: error: invalid use of incomplete type ‘class slade::audio::Music’
  385 |         else if (music_->openFromMemory((const char*)audio.data(), audio.size()))
      |                        ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:392:40: error: invalid use of incomplete type ‘class slade::audio::Music’
  392 |                 setAudioDuration(music_->getDuration().asMilliseconds());
      |                                        ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘void slade::AudioEntryPanel::startStream()’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:513:27: error: invalid use of incomplete type ‘class slade::audio::Music’
  513 |         case Music: music_->play(); break;
      |                           ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘void slade::AudioEntryPanel::stopStream() const’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:529:27: error: invalid use of incomplete type ‘class slade::audio::Music’
  529 |         case Music: music_->pause(); break;
      |                           ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘void slade::AudioEntryPanel::resetStream() const’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:545:27: error: invalid use of incomplete type ‘class slade::audio::Music’
  545 |         case Music: music_->stop(); break;
      |                           ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘void slade::AudioEntryPanel::onTimer(wxTimerEvent&)’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:714:33: error: invalid use of incomplete type ‘class slade::audio::Music’
  714 |         case Music: pos = music_->getPlayingOffset().asMilliseconds(); break;
      |                                 ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:726:51: error: invalid use of incomplete type ‘class slade::audio::Music’
  726 |                 || (audio_type_ == Music && music_->getStatus() == sf::Sound::Stopped)
      |                                                   ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘void slade::AudioEntryPanel::onSliderSeekChanged(wxCommandEvent&)’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:744:27: error: invalid use of incomplete type ‘class slade::audio::Music’
  744 |         case Music: music_->setPlayingOffset(sf::milliseconds(slider_seek_->GetValue())); break;
      |                           ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp: In member function ‘void slade::AudioEntryPanel::onSliderVolumeChanged(wxCommandEvent&)’:
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:762:27: error: invalid use of incomplete type ‘class slade::audio::Music’
  762 |         case Music: music_->setVolume(snd_volume); break;
      |                           ^~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.h:8:7: note: forward declaration of ‘class slade::audio::Music’
    8 | class Music;
      |       ^~~~~
/usr/include/c++/14/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = slade::audio::Music]’:
/usr/include/c++/14/bits/unique_ptr.h:398:17:   required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = slade::audio::Music; _Dp = std::default_delete<slade::audio::Music>]’
  398 |           get_deleter()(std::move(__ptr));
      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
PATH_TO_CLONED_REPO/slade/src/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp:73:2:   required from here
   73 |         music_{ new audio::Music() },
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unique_ptr.h:91:23: error: invalid application of ‘sizeof’ to incomplete type ‘slade::audio::Music’
   91 |         static_assert(sizeof(_Tp)>0,
      |                       ^~~~~~~~~~~
make[2]: *** [src/CMakeFiles/slade.dir/build.make:1291: src/CMakeFiles/slade.dir/MainEditor/UI/EntryPanel/AudioEntryPanel.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:232: src/CMakeFiles/slade.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Blzut3 commented 2 months ago

Would seem to indicate something about your system is causing the wrong file to be included rather than src/Audio/Music.h.

c0des1ayr commented 2 months ago

Strange, I tried adding src/ to the Audio/Music.h include and it...worked? Either way, thank you for pointing me to look at the includes, otherwise I would've been stuck for hours deciphering the errors. Closing now.