繁体   English   中英

FreeFileSync C ++错误:“字节”不是“标准”的成员

[英]FreeFileSync C++ error: 'byte' is not a member of 'std'

我正在尝试构建开源程序并遇到此错误:

$ make
mkdir -p ../Obj/FFS_GCC_Make_Release/ffs/src/base/
g++ -std=c++17 -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread `pkg-config --cflags gtk+-2.0` -c base/algorithm.cpp -o ../Obj/FFS_GCC_Make_Release/ffs/src/base/algorithm.o
In file included from base/../fs/abstract.h:13:0,
                 from base/structures.h:14,
                 from base/file_hierarchy.h:20,
                 from base/algorithm.h:11,
                 from base/algorithm.cpp:7:
../../zen/serialize.h:35:45: error: ‘byte’ is not a member of ‘std’
     using value_type     = std::vector<std::byte>::value_type;
                                             ^~~~
compilation terminated due to -Wfatal-errors.
Makefile:108: recipe for target '../Obj/FFS_GCC_Make_Release/ffs/src/base/algorithm.o' failed
make: *** [../Obj/FFS_GCC_Make_Release/ffs/src/base/algorithm.o] Error 1

此源文件包含#include <cstdint>

这是代码的问题部分: using value_type = std::vector<std::byte>::value_type;

如何复制:从官方网站下载FreeFileSync源,解压缩

cd FreeFileSync_10.4_Source\FreeFileSync\Source
make

适用于Linux的Windows子系统下的gcc版本7.3.0(Ubuntu 7.3.0-27ubuntu1〜18.04)

#include <cstddef>添加到serialize.h和ring_buffer.h中

cd ../../zen/
grep -q -F '<cstddef>' serialize.h || sed -i '1s/^/#include <cstddef>\n/' serialize.h
grep -q -F '<cstddef>' ring_buffer.h || sed -i '1s/^/#include <cstddef>\n/' ring_buffer.h

从C ++ 17开始实现std :: byte。 您可以检查编译器版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM