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 failure on Arch #138

Closed NyaomiDEV closed 2 years ago

NyaomiDEV commented 2 years ago

Trying to compile ffmpegfs 2.10 via the AUR; it returns some errors I don't know what to do about:

ffmpeg_utils.cc: In function ‘std::string fourcc_make_string(std::string*, uint32_t)’:
ffmpeg_utils.cc:1759:28: error: ‘strlen’ is not a member of ‘std’; did you mean ‘mbrlen’?
 1759 |     fourcc2str.resize(std::strlen(fourcc2str.c_str()));
      |                            ^~~~~~
      |                            mbrlen
ffmpeg_utils.cc: In function ‘std::string& ltrim(std::string&)’:
ffmpeg_utils.cc:1781:89: warning: ‘std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]’ is deprecated: use 'std::function' instead [-Wdeprecated-declarations]
 1781 |     s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
      |                                                                   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/12.1.0/string:48,
                 from ffmpeg_utils.h:51,
                 from ffmpeg_utils.cc:47:
/usr/include/c++/12.1.0/bits/stl_function.h:1126:5: note: declared here
 1126 |     ptr_fun(_Result (*__x)(_Arg))
      |     ^~~~~~~
ffmpeg_utils.cc:1781:66: warning: ‘constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = pointer_to_unary_function<int, int>]’ is deprecated: use 'std::not_fn' instead [-Wdeprecated-declarations]
 1781 |     s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
      |                                                         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12.1.0/bits/stl_function.h:1046:5: note: declared here
 1046 |     not1(const _Predicate& __pred)
      |     ^~~~
ffmpeg_utils.cc: In function ‘std::string& rtrim(std::string&)’:
ffmpeg_utils.cc:1787:80: warning: ‘std::pointer_to_unary_function<_Arg, _Result> std::ptr_fun(_Result (*)(_Arg)) [with _Arg = int; _Result = int]’ is deprecated: use 'std::function' instead [-Wdeprecated-declarations]
 1787 |     s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
      |                                                          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/12.1.0/bits/stl_function.h:1126:5: note: declared here
 1126 |     ptr_fun(_Result (*__x)(_Arg))
      |     ^~~~~~~
ffmpeg_utils.cc:1787:57: warning: ‘constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = pointer_to_unary_function<int, int>]’ is deprecated: use 'std::not_fn' instead [-Wdeprecated-declarations]
 1787 |     s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
      |                                                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12.1.0/bits/stl_function.h:1046:5: note: declared here
 1046 |     not1(const _Predicate& __pred)
      |     ^~~~
ffmpeg_utils.cc: In function ‘std::string implode(const STRINGSET&)’:
ffmpeg_utils.cc:2474:40: error: ‘ostream_iterator’ is not a member of ‘std’
 2474 |     std::copy(s.begin(), s.end(), std::ostream_iterator<std::string>(stream, ","));
      |                                        ^~~~~~~~~~~~~~~~
ffmpeg_utils.cc:82:1: note: ‘std::ostream_iterator’ is defined in header ‘<iterator>’; did you forget to ‘#include <iterator>’?
   81 | #include <libswresample/swresample.h>
  +++ |+#include <iterator>
   82 | #pragma GCC diagnostic pop
ffmpeg_utils.cc:2474:68: error: expected primary-expression before ‘>’ token
 2474 |     std::copy(s.begin(), s.end(), std::ostream_iterator<std::string>(stream, ","));
      |                                                                    ^
ffmpeg_utils.cc:2474:70: warning: left operand of comma operator has no effect [-Wunused-value]
 2474 |     std::copy(s.begin(), s.end(), std::ostream_iterator<std::string>(stream, ","));
      |                                                                      ^~~~~~
make[2]: *** [Makefile:566: ffmpeg_utils.o] Error 1
make[2]: *** Waiting for unfinished jobs....
fuseops.cc: In function ‘VIRTUALFILE* insert_dir(VIRTUALTYPE, const std::string&, const stat*, int)’:
fuseops.cc:510:10: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
  510 |     std::memcpy(&stbufdir, stbuf, sizeof(stbufdir));
      |          ^~~~~~
      |          wmemcpy
make[2]: *** [Makefile:566: fuseops.o] Error 1
make[2]: Leaving directory '/home/naomi/.cache/paru/clone/ffmpegfs/src/ffmpegfs-2.10/src'
make[1]: *** [Makefile:414: all] Error 2
make[1]: Leaving directory '/home/naomi/.cache/paru/clone/ffmpegfs/src/ffmpegfs-2.10/src'
make: *** [Makefile:469: all-recursive] Error 1

I am on Artix Linux with GCC 12.1.0 btw

nschlia commented 2 years ago

GCC 12.1.0?!? Guess they moved some things to a different header.

Need to get Arti Linux to check that. Or install GCC 12, lemme see :)

NyaomiDEV commented 2 years ago

Need to get Arti Linux to check that. Or install GCC 12, lemme see :)

Or also Arch! Gotta love rolling releases!

nschlia commented 2 years ago

Need to get Arti Linux to check that. Or install GCC 12, lemme see :)

Or also Arch! Gotta love rolling releases!

I was right. It seems that the GCC folks fiddled with the headers. To fix that, add

#include <cstring>

to fuseops.cc.

In ffmpeg_utils.cc you also need

#include <cstring>
#include <iterator>

Then it compiles. A deprecation warning remains, to get rid of it simply replace std::not1 with std::not_fn in ffmpeg_utils.cc. I'll push an update into Github.