nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
196 stars 14 forks source link

Compile Error on Fedora 35 #135

Closed Martin2112 closed 2 years ago

Martin2112 commented 2 years ago

I've started seeing a bunch of errors like this:

  CXX      transcode.o
In file included from transcode.cc:38:
ffmpeg_transcoder.h:483:113: error: 'optional' in namespace 'std' does not name a template type
  483 |     int                         add_subtitle_stream(AVCodecID codec_id, STREAMREF & input_streamref, const std::optional<std::string> &language = std::nullopt);
      |                                                                                                                 ^~~~~~~~
In file included from transcode.cc:38:
ffmpeg_transcoder.h:48:1: note: 'std::optional' is defined in header '<optional'; did you forget to '#include <optional>'?

Maybe I need to regenerate the build scripts or something?

nschlia commented 2 years ago

What does "gcc -v" return? I compiled the code with gcc 8.3.0, 10.2.1 and clang 11.0.1 without seeing this error.

nschlia commented 2 years ago

What happens if you add the header?

nschlia commented 2 years ago

Maybe I need to regenerate the build scripts or something?

I don*t think it will help, but it won't hurt doing

# autogen.sh
# configure

again.

Martin2112 commented 2 years ago

gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC)

Adding #include <optional.h> to ffmpeg_transcoder.h seems to fix the problem.

nschlia commented 2 years ago

gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC)

Adding #include <optional.h> to ffmpeg_transcoder.h seems to fix the problem.

OK, this is newer than mine, probably that's the reason. I haven't included the header anywhere, so it should have never worked.

Anyway, I'll add the include. Thanks for the hint.