我已经注意到了几篇文章:1,2,3,4,5,6,在C ++中真正常见的问题是“模板参数推导/替换失败”。但是,这些问题都没有涉及STL库头失败。
我尝试编译此C ++项目https://github.com/VincentShenbw/similarityjoin。为此,我使用g ++,boost和make配置了一个干净的Debian docker环境:
apt-get install build-essential
apt-get install libboost-all-dev
git clone https://github.com/VincentShenbw/similarityjoin.git
cd similarityjoin
make
AFAIK编译问题驻留在stl_multimap.h中:
In file included from /usr/include/c++/6/map:62:0,
from ../common/type.h:7,
from GlobFunc.h:11,
from GlobFunc.cpp:1: /usr/include/c++/6/bits/stl_multimap.h:1000:5: note: candidate: template<class _Key, class _Tp, class _Compare, class _Alloc> bool std ::operator!=(const std::multimap<_Key, _Tp, _Compare, _Alloc>&, const std::multimap<_Key, _Tp, _Compare, _Alloc>&)
operator!=(const multimap<_Key, _Tp, _Compare, _Alloc>& __x,
^~~~~~~~ /usr/include/c++/6/bits/stl_multimap.h:1000:5: note: template argument deduction/substitution failed: In file included from /usr/include/_G_config.h:15:0,
from /usr/include/libio.h:31,
from /usr/include/stdio.h:74,
from /usr/include/c++/6/cstdio:42,
from /usr/include/c++/6/ext/string_conversions.h:43,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from GlobFunc.h:2,
from GlobFunc.cpp:1: GlobFunc.cpp:76:36: note: 'std::basic_istream<char>' is not derived from 'const std::multimap<_Key, _Tp, _Compare, _Alloc>' while (getline(in, line, '\n') != NULL)
我应该尝试修复STL标头吗?这是错误的STL版本的问题吗?