我如何在从 Azerothcore 制作时修复此错误?

How can I fix this error at make from Azerothcore?

我正在使用 Azerothcore 的文档安装它,在我使用命令 "make" 时出现以下错误:

/home/wowazerothcore/azerothcore/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp:57:65: fatal error: no matching constructor for initialization of 'const std::unordered_map<uint32, std::tuple<uint32, Position> >'
std::unordered_map<uint32, std::tuple <uint32, Position>> const npcSummon =
                                                                ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:139:7: note: candidate constructor not viable: cannot convert initializer list argument to 'size_type' (aka 'unsigned long')
      unordered_map(size_type __n = 10,
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:214:7: note: candidate constructor not viable: no known conversion from 'Misc' to
      'std::pair<const unsigned int, std::tuple<unsigned int, Position> >' for 1st argument
      unordered_map(initializer_list<value_type> __l,
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:160:2: note: candidate template ignored: couldn't infer template argument '_InputIterator'
        unordered_map(_InputIterator __f, _InputIterator __l,
        ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:188:7: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
      unordered_map(const unordered_map& __umap,
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:198:7: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
      unordered_map(unordered_map&& __umap,
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:169:7: note: candidate constructor not viable: requires 1 argument, but 3 were provided
      unordered_map(const unordered_map&) = default;
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:172:7: note: candidate constructor not viable: requires 1 argument, but 3 were provided
      unordered_map(unordered_map&&) = default;
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unordered_map.h:179:7: note: candidate constructor not viable: requires single argument '__a', but 3 arguments were provided
      unordered_map(const allocator_type& __a)
      ^
1 error generated.
src/server/scripts/CMakeFiles/scripts.dir/build.make:13452: recipe for target 'src/server/scripts/CMakeFiles/scripts.dir/Northrend/DraktharonKeep/boss_novos.cpp.o' failed
make[2]: *** [src/server/scripts/CMakeFiles/scripts.dir/Northrend/DraktharonKeep/boss_novos.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1558: recipe for target 'src/server/scripts/CMakeFiles/scripts.dir/all' failed
make[1]: *** [src/server/scripts/CMakeFiles/scripts.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

我该如何解决这个错误?

"git log" 命令的第一行如下:

wowazerothcore@rs000165:~/azerothcore$ git 日志

提交 2bb868164e545d38da5c96a3ce683a5fcb3b72a6

gcc 版本是

wowazerothcore@rs000165:~/azerothcore$ gcc --version

gcc (Debian 4.9.2-10+deb8u2) 4.9.2

我怀疑您看到的错误的原因是旧版本的 gcc,因为编译器指向 gcc 包含文件。

之所以 apt-get update 显示所有包都是最新的,是因为

Debian GNU/Linux 8.11 (jessie) Release: 8.11 Codename: jessie

是旧版本的 Debian。根据 Debian 软件包搜索: https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=gcc

Package gcc
jessie (oldoldstable) (devel): GNU C compiler
4:4.9.2-2: amd64 armel armhf i386
stretch (oldstable) (devel): GNU C compiler
4:6.3.0-4: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64el s390x
buster (stable) (devel): GNU C compiler
4:8.3.0-1: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64el s390x

4.9 是您系统上支持的最高稳定 gcc 版本。

建议的解决方案:

1) 从 Debian 8 (jessie) 升级到 Debian 9 (stretch) 或 Debian 10 (buster) 此处说明:https://phoenixnap.com/kb/how-to-upgrade-debian-8-jessie-to-debian-9-stretch

2) 将测试仓库添加到您的 apt-repos,固定更高版本的 gcc,apt-update 并从测试仓库安装更高版本的 gcc。此处说明: https://unix.stackexchange.com/questions/284817/how-to-install-gcc-5-on-debian-jessie-8-1

第一种方式可能存在一定的风险,建议您做好数据备份,以防万一。

第二个选项基本上是使用没有 Debian 组优先支持的软件包,所以你的里程可能会有所不同。