我正在尝试在此存储库中编译源代码:
https://github.com/MaartenBaert/ssr
以及这个特定源文件的编译错误:
https://github.com/MaartenBaert/ssr/blob/master/src/GUI/PageOutput.cpp
出现以下错误:
../../src/GUI/PageOutput.cpp:66: error: no match for ‘operator=’ in ‘((PageOutput*)this)->PageOutput::m_containers = {{"Matroska (MKV)", "matroska", {"mkv"}, "Matroska files (*.mkv)", {(PageOutput::enum_video_codec)0u, (PageOutput::enum_video_codec)1u, (PageOutput::enum_video_codec)2u}, {(PageOutput::enum_audio_codec)0u, (PageOutput::enum_audio_codec)1u, (PageOutput::enum_audio_codec)2u, (PageOutput::enum_audio_codec)3u}}, {"MP4", "mp4", {"mp4"}, "MP4 files (*.mp4)", {(PageOutput::enum_video_codec)0u}, {(PageOutput::enum_audio_codec)0u, (PageOutput::enum_audio_codec)1u, (PageOutput::enum_audio_codec)2u}}, {"WebM", "webm", {"webm"}, "WebM files (*.webm)", {(PageOutput::enum_video_codec)1u}, {(PageOutput::enum_audio_codec)0u}}, {"OGG", "ogg", {"ogg"}, "OGG files (*.ogg)", {(PageOutput::enum_video_codec)2u}, {(PageOutput::enum_audio_codec)0u}}, {"Other...", "", <brace-enclosed initializer list>(), "", <brace-enclosed initializer list>(), <brace-enclosed initializer list>()}}’
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.6/../../../../include/c++/4.4.6/bits/vector.tcc:156: note: candidates are: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = PageOutput::ContainerData, _Alloc = std::allocator<PageOutput::ContainerData>]
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.6/../../../../include/c++/4.4.6/bits/stl_vector.h:336: note: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = PageOutput::ContainerData, _Alloc = std::allocator<PageOutput::ContainerData>]
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.6/../../../../include/c++/4.4.6/bits/stl_vector.h:356: note: std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = PageOutput::ContainerData, _Alloc = std::allocator<PageOutput::ContainerData>]
make[2]: *** [simplescreenrecorder-PageOutput.o] Error 1
有问题的代码,格式正确:
m_containers = {
{"Matroska (MKV)", "matroska", {"mkv"}, "Matroska files (*.mkv)",
{VIDEO_CODEC_H264, VIDEO_CODEC_VP8, VIDEO_CODEC_THEORA},
{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC, AUDIO_CODEC_UNCOMPRESSED}},
{"MP4", "mp4", {"mp4"}, "MP4 files (*.mp4)" ,
{VIDEO_CODEC_H264},
{AUDIO_CODEC_VORBIS, AUDIO_CODEC_MP3, AUDIO_CODEC_AAC}},
{"WebM", "webm", {"webm"}, "WebM files (*.webm)" ,
{VIDEO_CODEC_VP8},
{AUDIO_CODEC_VORBIS,}},
{"OGG", "ogg", {"ogg"}, "OGG files (*.ogg)" ,
{VIDEO_CODEC_THEORA},
{AUDIO_CODEC_VORBIS}},
{"Other...", "", {}, "", {}, {}},
};
我更像是一个 C 程序员,我的 C++ 有点生疏。我四处搜索,错误很常见,但还无法准确找出这个错误。