pip010 / sparsehash

Automatically exported from code.google.com/p/sparsehash
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Source won't compile on Unix systems #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Check out revision 46 from trunk
2. Run ./configure
3. Run make

What is the expected output? What do you see instead?
Got the following error:
./src/google/sparsehash/sparsehashtable.h: In member function `void 
google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, 
Alloc>::move_from(google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, 
SetKey, EqualKey, 
Alloc>::MoveDontCopyT, google::sparse_hashtable<Value, Key, HashFcn, 
ExtractKey, SetKey, 
EqualKey, Alloc>&, size_t) [with Value = std::pair<const std::string, 
std::string>, Key = 
std::string, HashFcn = __gnu_cxx::hash<std::string>, ExtractKey = 
google::sparse_hash_map<std::string, std::string, __gnu_cxx::hash<std::string>, 
std::equal_to<std::string>, std::allocator<std::string> >::SelectKey, SetKey = 
google::sparse_hash_map<std::string, std::string, __gnu_cxx::hash<std::string>, 
std::equal_to<std::string>, std::allocator<std::string> >::SetKey, EqualKey = 
std::equal_to<std::string>, Alloc = std::allocator<std::string>]':
./src/google/sparsehash/sparsehashtable.h:738:   instantiated from 
`google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, 
Alloc>::sparse_hashtable(google::sparse_hashtable<Value, Key, HashFcn, 
ExtractKey, SetKey, 
EqualKey, Alloc>::MoveDontCopyT, google::sparse_hashtable<Value, Key, HashFcn, 
ExtractKey, 
SetKey, EqualKey, Alloc>&, size_t) [with Value = std::pair<const std::string, 
std::string>, Key = 
std::string, HashFcn = __gnu_cxx::hash<std::string>, ExtractKey = 
google::sparse_hash_map<std::string, std::string, __gnu_cxx::hash<std::string>, 
std::equal_to<std::string>, std::allocator<std::string> >::SelectKey, SetKey = 
google::sparse_hash_map<std::string, std::string, __gnu_cxx::hash<std::string>, 
std::equal_to<std::string>, std::allocator<std::string> >::SetKey, EqualKey = 
std::equal_to<std::string>, Alloc = std::allocator<std::string>]'
./src/google/sparsehash/sparsehashtable.h:435:   instantiated from `void 
google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, 
Alloc>::squash_deleted() [with Value = std::pair<const std::string, 
std::string>, Key = std::string, 
HashFcn = __gnu_cxx::hash<std::string>, ExtractKey = 
google::sparse_hash_map<std::string, 
std::string, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, 
std::allocator<std::string> 
>::SelectKey, SetKey = google::sparse_hash_map<std::string, std::string, 
__gnu_cxx::hash<std::string>, std::equal_to<std::string>, 
std::allocator<std::string> >::SetKey, 
EqualKey = std::equal_to<std::string>, Alloc = std::allocator<std::string>]'
./src/google/sparsehash/sparsehashtable.h:444:   instantiated from `void 
google::sparse_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, 
Alloc>::set_deleted_key(const Key&) [with Value = std::pair<const std::string, 
std::string>, Key = 
std::string, HashFcn = __gnu_cxx::hash<std::string>, ExtractKey = 
google::sparse_hash_map<std::string, std::string, __gnu_cxx::hash<std::string>, 
std::equal_to<std::string>, std::allocator<std::string> >::SelectKey, SetKey = 
google::sparse_hash_map<std::string, std::string, __gnu_cxx::hash<std::string>, 
std::equal_to<std::string>, std::allocator<std::string> >::SetKey, EqualKey = 
std::equal_to<std::string>, Alloc = std::allocator<std::string>]'
./src/google/sparse_hash_map:269:   instantiated from `void 
google::sparse_hash_map<Key, T, 
HashFcn, EqualKey, Alloc>::set_deleted_key(const typename 
google::sparse_hashtable<std::pair<const _Key, _Tp>, Key, HashFcn, 
google::sparse_hash_map<Key, T, HashFcn, EqualKey, Alloc>::SelectKey, 
google::sparse_hash_map<Key, T, HashFcn, EqualKey, Alloc>::SetKey, EqualKey, 
Alloc>::key_type&) [with Key = std::string, T = std::string, HashFcn = 
__gnu_cxx::hash<std::string>, EqualKey = std::equal_to<std::string>, Alloc = 
std::allocator<std::string>]'
src/hashtable_unittest.cc:1084:   instantiated from here
./src/google/sparsehash/sparsehashtable.h:654: error: no match for call to 
`(__gnu_cxx::hash<std::string>) (const std::basic_string<char, 
std::char_traits<char>, 
std::allocator<char> >&)'
make[1]: *** [hashtable_unittest.o] Error 1

What version of the product are you using? On what operating system?
Tried it on 2 operating systems:
* Red Hat Enterprise Linux WS release 4 (Nahant Update 3)
* OpenSolaris 2008.11 snv_101b_rc2 X86

Please provide any additional information below.
When I roll back to revision 44, everything works fine.

Original issue reported on code.google.com by shiranpa...@gmail.com on 24 Dec 2009 at 5:55

GoogleCodeExporter commented 9 years ago
Weird, I thought I had compiled the unittest before I submitted the last SVN
revision, but maybe not.  It does look like I did an incomplete job of adding 
StrHash
as the hash function template-parameter everywhere I was hashing a string.

I believe the fix is to just change
   sparse_hash_map<string, XXX>
to
   sparse_hash_map<string, XXX, StrHash>
and likewise with dense_hash_map.  We also need to change
   sparse_hash_map<char*, XXX>
if any of those occur.

I'll take care of it after I'm back from vacation.  If you'd like to do the 
patch
earlier than that, feel free, and can attach it here!

Original comment by csilv...@gmail.com on 25 Dec 2009 at 7:17

GoogleCodeExporter commented 9 years ago
I've got a fix that works for me, that I'm having reviewed right now.  Once 
it's been 
ok'ed, I'll let you know.  May be next year, though!

Original comment by csilv...@gmail.com on 31 Dec 2009 at 2:00

GoogleCodeExporter commented 9 years ago
This should be resolved in sparsehash 1.6, just released.

Original comment by csilv...@gmail.com on 11 Jan 2010 at 10:53