Rnnlib安装范围错误

时间:2015-12-17 06:22:09

标签: boost makefile install boost-python recurrent-neural-network

我正在通过DWORD

安装rnnlib

安装了boost和其他步骤并完成其他步骤后,我收到错误 - SeqBuffer.hpp:227: error: reference to ‘range’ is ambiguous Helpers.hpp:298: error: candidates are: template<class T> std::pair<boost::iterators::counting_iterator<Incrementable, boost::iterators::use_default, boost::iterators::use_default>, boost::iterators::counting_iterator<Incrementable, boost::iterators::use_default, boost::iterators::use_default> > range(const T&, const T&)

Makefile:223: recipe for target 'DataExporter.o' failed
make[2]: *** [DataExporter.o] Error 1
make[2]: Leaving directory '/home/adminhp/Himaanshu/RNNLIB-master/src'
Makefile:217: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/adminhp/Himaanshu/RNNLIB-master'
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2

1 个答案:

答案 0 :(得分:2)

using namespace再次罢工。

Helpers.hpp包含以下诅咒序列:

using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace boost::posix_time;
using namespace boost::gregorian;

坦率地说,此时我会放弃。特别是前两行是地毯式轰炸的道德等同物。用napalm.¹

更新已创建a pull request with the changes required to make the code compile

为了进一步加剧问题,RNNLIB的range工具甚至不在命名空间中......

因此,结果是range与来自boost的命名空间发生冲突。

删除冲突的最简单方法是将range的所有循环使用限定为::range ...

  

PS。

以后equal提出了同样的问题

¹Why is "using namespace std" considered bad practice?