编译运行Fast_RNRR报错及解决 (二)

日期:2021/12/1

报错

之前编译运行Fast_RNRR时完全没有问题,命令如下:

cmake -DCMAKE_BUILD_TYPE=Release ..
make

可是今天再按照上面的方式编译运行的时候,出现大面积的报错,比如:

/usr/include/c++/5/bits/unordered_map.h: In member function ‘void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator, _InputIterator)’:
/usr/include/c++/5/bits/unordered_map.h:489:9: error: request for member ‘insert’ in ‘((std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>*)this)->std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::_M_h’, which is of non-class type ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::_Hashtable {aka int}’
  { _M_h.insert(__first, __last); }
         ^
/usr/include/c++/5/bits/unordered_map.h: In member function ‘void std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(std::initializer_list<int>)’:
/usr/include/c++/5/bits/unordered_map.h:500:14: error: request for member ‘insert’ in ‘((std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>*)this)->std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::_M_h’, which is of non-class type ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::_Hashtable {aka int}’
       { _M_h.insert(__l); }

又比如:

In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/5/vector:60,
                 from /home/sun/Fast_RNRR/include/nanoflann.hpp:49,
                 from /home/sun/Fast_RNRR/src/tools/nanoflann.h:2,
                 from /home/sun/Fast_RNRR/src/Registration.h:3,
                 from /home/sun/Fast_RNRR/src/NonRigidreg.h:3,
                 from /home/sun/Fast_RNRR/src/NonRigidreg.cpp:2:
/usr/include/c++/5/bits/stl_pair.h: In instantiation of ‘struct std::pair<int, int>’:
/usr/include/c++/5/bits/unordered_map.h:646:7:   required from here
/usr/include/c++/5/bits/stl_pair.h:168:16: error: ‘std::pair<_T1, _T2>::is_nothrow_move_assignable’ has incomplete type
                is_nothrow_move_assignable<_T2>>::value)
                ^
/usr/include/c++/5/bits/stl_pair.h:96:12: note: definition of ‘struct std::pair<int, int>’ is not complete until the closing brace
     struct pair

还比如:

/usr/include/c++/5/bits/unordered_map.h:865:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::allocator_type allocator_type;
                        ^
/usr/include/c++/5/bits/unordered_map.h:870:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::pointer  pointer;
                        ^
/usr/include/c++/5/bits/unordered_map.h:871:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::const_pointer const_pointer;
                        ^
/usr/include/c++/5/bits/unordered_map.h:872:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::reference  reference;
                        ^
/usr/include/c++/5/bits/unordered_map.h:873:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::const_reference const_reference;
                        ^
/usr/include/c++/5/bits/unordered_map.h:874:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::iterator  iterator;
                        ^
/usr/include/c++/5/bits/unordered_map.h:875:24: error: ‘_Hashtable’ is not a class, namespace, or enumeration
       typedef typename _Hashtable::const_iterator const_iterator;

总之,错误非常多,看起来令人瑟瑟发抖。

However,

解决方法

只需要采用如下语句编译运行即可:

 cmake -DCMAKE_BUILD_TYPE=Release ..
 sudo make -j8

啊哈哈哈,本来以为又要在这个问题上耗费好几天的时间,没想到这么快就解决了,果然,只有我想不到,没有大佬做不到,我又行了!

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

兔子的倔强

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值