obs-websocket icon indicating copy to clipboard operation
obs-websocket copied to clipboard

Use of std::optional breaks build on GCC 6.3.0 (and others)

Open Rosuav opened this issue 6 years ago • 4 comments

Issue type

Bug report

Description

std::optional is a C++17 feature and not available on all compilers. Its use mandates a very recent compiler, but the cmake configuration doesn't error out.

Steps to reproduce and other useful info

Checkout commit a0dce77 or anything newer. Attempt to build. If your GCC is new enough to claim to support (some of) C++17, but not new enough to be able to #include , the build will bomb out.

Technical information
  • Operating System : Debian GNU/Linux 9.12
  • OBS Studio version : 25.0.7
Development Environment

gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 (Also tested on gcc from Debian Buster but I don't have a version string for that - same issue though) cmake -DLIBOBS_INCLUDE_DIR=/home/rosuav/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr ..

Rosuav avatar May 11 '20 19:05 Rosuav

Cannot reproduce on GCC 8.3.0 on Debian Buster 10.4. Build just worked without issues.

stephenangelico avatar May 12 '20 08:05 stephenangelico

OBS-Studio requires C++17, as such it would not be reasonable to continue to support compilers without c++17 functionality.

tt2468 avatar Jul 10 '20 02:07 tt2468

But if it's not supported, the cmake setup should detect this and prevent it. It should error out during the configuration, NOT during the build afterwards. That's the whole point of the configure step.

Rosuav avatar Jul 10 '20 04:07 Rosuav

I agree with @Rosuav .... and I don't believe OBS requires C++17, because I've build it just fine on Debian 9:

-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0

lingfish avatar Jan 02 '21 04:01 lingfish