aria2下载地址:https://github.com/aria2/aria2/releases/tag/release-1.34.0
下载tar.gz包:aria2-release-1.34.0.tar.gz
解压:tar -xzvf aria2-release-1.34.0
编译:cd aria2-release-1.34.0 ; ./configure ; make
报错:
……………………
CXX InternalDHKeyExchange.lo
In file included from InternalDHKeyExchange.h:40:0,
from InternalDHKeyExchange.cc:36:
bignum.h: In constructor 'bignum::ulong<dim>::ulong()':
bignum.h:34:25: error: 'make_unique' was not declared in this scope
inline ulong() : buf_(make_unique<char_t[]>(dim)) {}
^
bignum.h:34:43: error: expected primary-expression before '[' token
inline ulong() : buf_(make_unique<char_t[]>(dim)) {}
^
bignum.h:34:44: error: expected primary-expression before ']' token
inline ulong() : buf_(make_unique<char_t[]>(dim)) {}
^
bignum.h: In constructor 'bignum::ulong<dim>::ulong(size_t)':
bignum.h:35:33: error: 'make_unique' was not declared in this scope
inline ulong(size_t t) : buf_(make_unique<char_t[]>(dim))
^
bignum.h:35:51: error: expected primary-expression before '[' token
inline ulong(size_t t) : buf_(make_unique<char_t[]>(dim))
……………………
第一感觉:这是git上release版本不应该会有类似错误,一定是我哪里配置的不对,上网百度想办法吧,尝试了以下方法:
1.网上说std有make_unique这个方法,怀疑是没有引用std,于是在bignum.h 的make_unique 前面都加上了 std:: 结果报错:make_unique 不是 std 的成员。。。失败;
2.又有一篇帖子说在bignum.h增加一段代码,但是帖子并没有详细说明加在哪里,俺也不知道,俺也不敢问,随便找了2个地方加上尝试仍然报错。。。没有继续尝试——失败;
3.算了在源码路径下看有没有定义吧,于是:
发现头文件:a2functional.h 中有类似的定义,于是在 bignum.h 中引用该头文件 #include “a2functional.h”,结果仍然失败;
4.既然不能引用头文件,能不能把声明直接拿过来用呢?试一下不就知道了吗,搞起来,于是将a2functional.h中关于make_unique部分的声明拿了一份到bignum.h中,改成如下图(#if ………………#endif 部分):
重新make,奇迹发生了——成功!
问题解决!