motrix icon indicating copy to clipboard operation
motrix copied to clipboard

build error std::runtime_error

Open Criispin opened this issue 5 years ago • 4 comments

Criispin avatar Nov 22 '20 21:11 Criispin

I've looked at this a few times, but I don't see where <stdexcept> is needed for these headers. Are there some cpp files that need this header directly?

vtnerd avatar Jan 28 '21 21:01 vtnerd

my compiler throws this at me

../src/display/falling_text.cpp:86:18: Fehler: »runtime_error« ist kein Element von »std« 86 | throw std::runtime_error{"failed to create ncurses window"};

https://github.com/vtnerd/motrix/blob/163ec8f04c15d6024d54c79f6d6c5b336ecb0446/src/display/falling_text.cpp#L86

Criispin avatar Feb 04 '21 14:02 Criispin

I can confirm this issue, it seems that the function std::runtime_error (seen in src/display/falling_text.cpp:86 and src/display/system_warning.cpp:48) requires the library <stdexcept>. Building on Arch, gcc version 10.2.0. Acutally, I think I see what's happened, it seems that the include in src/display/window.cpp was supposed to be included in src/display/window.hpp which is what's inlcuded in the files where this seems to be an issue, moving that include to the header as opposed to the cpp file should resolve this as well.

nalal avatar Feb 26 '21 22:02 nalal

The #include <stdexcept> should be in those two cpp fies, which call throw std::runtime_error{...}, as opposed to indirectly pulled from headers.

vtnerd avatar Mar 04 '21 18:03 vtnerd

Wondering if this will be revisited and the #includes are added to the .cpp files since it fails to compile with g++ 12.3.0

jeffro256 avatar Feb 16 '24 05:02 jeffro256

@jeffro256 I have pushed the necessary includes to get it working with gcc 12+. I have also reverted back to the original system warning message. I am closing this, as its no longer needed.

vtnerd avatar Feb 17 '24 23:02 vtnerd

Very

Ericmagsllonstrigs avatar Mar 04 '24 18:03 Ericmagsllonstrigs

M

Ericmagsllonstrigs avatar Mar 04 '24 18:03 Ericmagsllonstrigs

  • Nocturno

Ericmagsllonstrigs avatar Mar 04 '24 18:03 Ericmagsllonstrigs

I r

Ericmagsllonstrigs avatar Mar 04 '24 18:03 Ericmagsllonstrigs