Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long

Discussion in 'C++' started by veryhotsausage, Jul 4, 2008.

  1. I'm really hoping that someone can give me some pointers. I've been
    using sparsehash on windows with no problems, but when i tried to
    compile the same code on linux, it threw a fit.

    I've been using linux for about a week and eclipse for about 3 days so
    please excuse my ignorance.

    My code to use sparsehash compiles under eclipse (no red lines) but
    I'm getting a bunch of really cryptic messages which basically says
    this:

    /usr/local/include/google/sparsehash/densehashtable.h:656: error: no
    match for call to ‘(const __gnu_cxx::hash<long long int>) (const long
    long int&)’

    I think it's a compiler error but i have no idea how to solve it.

    Thank you in advance

    ------------------------------------------------

    The entire message is as follows:

    /usr/local/include/google/sparsehash/densehashtable.h:521: error: no
    match for call to ‘(__gnu_cxx::hash<long long int>) (const long long
    int&)’
    /usr/local/include/google/sparsehash/densehashtable.h: In member
    function ‘std::pair<unsigned int, unsigned int>
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>::find_position(const Key&) const [with Value = std::pair<const
    long long int, indigo::common::Feature>, Key = long long int, HashFcn
    = __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::common::Feature,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::common::Feature> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::common::Feature>]’:
    /usr/local/include/google/sparsehash/densehashtable.h:681:
    instantiated from ‘google::dense_hashtable_iterator<V, K, HF, ExK,
    EqK, A> google::dense_hashtable<Value, Key, HashFcn, ExtractKey,
    EqualKey, Alloc>::find(const Key&) [with Value = std::pair<const long
    long int, indigo::common::Feature>, Key = long long int, HashFcn =
    __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::common::Feature,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::common::Feature> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::common::Feature>]’
    /usr/local/include/google/dense_hash_map:185: instantiated from
    ‘typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::iterator
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::find(const
    typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::key_type&) [with Key = long long
    int, T = indigo::common::Feature, HashFcn = __gnu_cxx::hash<long long
    int>, EqualKey = std::equal_to<long long int>, Alloc =
    std::allocator<indigo::common::Feature>]’
    ../src/indigo.tree/tree_gen.cpp:52: instantiated from here
    /usr/local/include/google/sparsehash/densehashtable.h:656: error: no
    match for call to ‘(const __gnu_cxx::hash<long long int>) (const long
    long int&)’
    /usr/local/include/google/sparsehash/densehashtable.h: In member
    function ‘std::pair<unsigned int, unsigned int>
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>::find_position(const Key&) const [with Value = std::pair<const
    long long int, int>, Key = long long int, HashFcn =
    __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, int, __gnu_cxx::hash<long long
    int>, std::equal_to<long long int>, std::allocator<int> >::SelectKey,
    EqualKey = std::equal_to<long long int>, Alloc =
    std::allocator<int>]’:
    /usr/local/include/google/sparsehash/densehashtable.h:681:
    instantiated from ‘google::dense_hashtable_iterator<V, K, HF, ExK,
    EqK, A> google::dense_hashtable<Value, Key, HashFcn, ExtractKey,
    EqualKey, Alloc>::find(const Key&) [with Value = std::pair<const long
    long int, int>, Key = long long int, HashFcn = __gnu_cxx::hash<long
    long int>, ExtractKey = google::dense_hash_map<long long int, int,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<int> >::SelectKey, EqualKey = std::equal_to<long long
    int>, Alloc = std::allocator<int>]’
    /usr/local/include/google/dense_hash_map:185: instantiated from
    ‘typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::iterator
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::find(const
    typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::key_type&) [with Key = long long
    int, T = int, HashFcn = __gnu_cxx::hash<long long int>, EqualKey =
    std::equal_to<long long int>, Alloc = std::allocator<int>]’
    ../src/indigo.tree/tree_gen.cpp:437: instantiated from here
    /usr/local/include/google/sparsehash/densehashtable.h:656: error: no
    match for call to ‘(const __gnu_cxx::hash<long long int>) (const long
    long int&)’
    /usr/local/include/google/sparsehash/densehashtable.h: In member
    function ‘std::pair<unsigned int, unsigned int>
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>::find_position(const Key&) const [with Value = std::pair<const
    long long int, indigo::tree::GenChangeRecord>, Key = long long int,
    HashFcn = __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::tree::GenChangeRecord,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::tree::GenChangeRecord> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’:
    /usr/local/include/google/sparsehash/densehashtable.h:681:
    instantiated from ‘google::dense_hashtable_iterator<V, K, HF, ExK,
    EqK, A> google::dense_hashtable<Value, Key, HashFcn, ExtractKey,
    EqualKey, Alloc>::find(const Key&) [with Value = std::pair<const long
    long int, indigo::tree::GenChangeRecord>, Key = long long int, HashFcn
    = __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::tree::GenChangeRecord,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::tree::GenChangeRecord> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    /usr/local/include/google/dense_hash_map:185: instantiated from
    ‘typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::iterator
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::find(const
    typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::key_type&) [with Key = long long
    int, T = indigo::tree::GenChangeRecord, HashFcn = __gnu_cxx::hash<long
    long int>, EqualKey = std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    /usr/local/include/google/dense_hash_map:189: instantiated from ‘T&
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::eek:perator[]
    (const typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::key_type&) [with Key = long long
    int, T = indigo::tree::GenChangeRecord, HashFcn = __gnu_cxx::hash<long
    long int>, EqualKey = std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    ../src/indigo.tree/tree_gen.cpp:452: instantiated from here
    /usr/local/include/google/sparsehash/densehashtable.h:656: error: no
    match for call to ‘(const __gnu_cxx::hash<long long int>) (const long
    long int&)’
    /usr/local/include/google/sparsehash/densehashtable.h: In member
    function ‘void google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::copy_from(const
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>&, size_t) [with Value = std::pair<const long long int, int>,
    Key = long long int, HashFcn = __gnu_cxx::hash<long long int>,
    ExtractKey = google::dense_hash_map<long long int, int,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<int> >::SelectKey, EqualKey = std::equal_to<long long
    int>, Alloc = std::allocator<int>]’:
    /usr/local/include/google/sparsehash/densehashtable.h:571:
    instantiated from ‘google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::dense_hashtable(const
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>&, size_t) [with Value = std::pair<const long long int, int>,
    Key = long long int, HashFcn = __gnu_cxx::hash<long long int>,
    ExtractKey = google::dense_hash_map<long long int, int,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<int> >::SelectKey, EqualKey = std::equal_to<long long
    int>, Alloc = std::allocator<int>]’
    /usr/local/include/google/sparsehash/densehashtable.h:466:
    instantiated from ‘void google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::resize_delta(size_t, size_t) [with Value
    = std::pair<const long long int, int>, Key = long long int, HashFcn =
    __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, int, __gnu_cxx::hash<long long
    int>, std::equal_to<long long int>, std::allocator<int> >::SelectKey,
    EqualKey = std::equal_to<long long int>, Alloc = std::allocator<int>]’
    /usr/local/include/google/sparsehash/densehashtable.h:743:
    instantiated from ‘std::pair<google::dense_hashtable_iterator<V, K,
    HF, ExK, EqK, A>, bool> google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::insert(const Value&) [with Value =
    std::pair<const long long int, int>, Key = long long int, HashFcn =
    __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, int, __gnu_cxx::hash<long long
    int>, std::equal_to<long long int>, std::allocator<int> >::SelectKey,
    EqualKey = std::equal_to<long long int>, Alloc = std::allocator<int>]’
    /usr/local/include/google/dense_hash_map:207: instantiated from
    ‘std::pair<typename google::dense_hashtable<std::pair<const Key, T>,
    Key, HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::iterator, bool>
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::insert(const
    typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::value_type&) [with Key = long
    long int, T = int, HashFcn = __gnu_cxx::hash<long long int>, EqualKey
    = std::equal_to<long long int>, Alloc = std::allocator<int>]’
    /usr/local/include/google/dense_hash_map:193: instantiated from ‘T&
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::eek:perator[]
    (const typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::key_type&) [with Key = long long
    int, T = int, HashFcn = __gnu_cxx::hash<long long int>, EqualKey =
    std::equal_to<long long int>, Alloc = std::allocator<int>]’
    ../src/indigo.tree/tree_gen.cpp:379: instantiated from here
    /usr/local/include/google/sparsehash/densehashtable.h:521: error: no
    match for call to ‘(__gnu_cxx::hash<long long int>) (const long long
    int&)’
    /usr/local/include/google/sparsehash/densehashtable.h: In member
    function ‘void google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::copy_from(const
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>&, size_t) [with Value = std::pair<const long long int,
    indigo::tree::GenChangeRecord>, Key = long long int, HashFcn =
    __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::tree::GenChangeRecord,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::tree::GenChangeRecord> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’:
    /usr/local/include/google/sparsehash/densehashtable.h:571:
    instantiated from ‘google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::dense_hashtable(const
    google::dense_hashtable<Value, Key, HashFcn, ExtractKey, EqualKey,
    Alloc>&, size_t) [with Value = std::pair<const long long int,
    indigo::tree::GenChangeRecord>, Key = long long int, HashFcn =
    __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::tree::GenChangeRecord,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::tree::GenChangeRecord> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    /usr/local/include/google/sparsehash/densehashtable.h:466:
    instantiated from ‘void google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::resize_delta(size_t, size_t) [with Value
    = std::pair<const long long int, indigo::tree::GenChangeRecord>, Key =
    long long int, HashFcn = __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::tree::GenChangeRecord,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::tree::GenChangeRecord> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    /usr/local/include/google/sparsehash/densehashtable.h:743:
    instantiated from ‘std::pair<google::dense_hashtable_iterator<V, K,
    HF, ExK, EqK, A>, bool> google::dense_hashtable<Value, Key, HashFcn,
    ExtractKey, EqualKey, Alloc>::insert(const Value&) [with Value =
    std::pair<const long long int, indigo::tree::GenChangeRecord>, Key =
    long long int, HashFcn = __gnu_cxx::hash<long long int>, ExtractKey =
    google::dense_hash_map<long long int, indigo::tree::GenChangeRecord,
    __gnu_cxx::hash<long long int>, std::equal_to<long long int>,
    std::allocator<indigo::tree::GenChangeRecord> >::SelectKey, EqualKey =
    std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    /usr/local/include/google/dense_hash_map:207: instantiated from
    ‘std::pair<typename google::dense_hashtable<std::pair<const Key, T>,
    Key, HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::iterator, bool>
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::insert(const
    typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::value_type&) [with Key = long
    long int, T = indigo::tree::GenChangeRecord, HashFcn =
    __gnu_cxx::hash<long long int>, EqualKey = std::equal_to<long long
    int>, Alloc = std::allocator<indigo::tree::GenChangeRecord>]’
    /usr/local/include/google/dense_hash_map:193: instantiated from ‘T&
    google::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::eek:perator[]
    (const typename google::dense_hashtable<std::pair<const Key, T>, Key,
    HashFcn, google::dense_hash_map<Key, T, HashFcn, EqualKey,
    Alloc>::SelectKey, EqualKey, Alloc>::key_type&) [with Key = long long
    int, T = indigo::tree::GenChangeRecord, HashFcn = __gnu_cxx::hash<long
    long int>, EqualKey = std::equal_to<long long int>, Alloc =
    std::allocator<indigo::tree::GenChangeRecord>]’
    ../src/indigo.tree/tree_gen.cpp:452: instantiated from here
    /usr/local/include/google/sparsehash/densehashtable.h:521: error: no
    match for call to ‘(__gnu_cxx::hash<long long int>) (const long long
    int&)’
    make: *** [src/indigo.tree/tree_gen.o] Error 1
     
    veryhotsausage, Jul 4, 2008
    #1
    1. Advertising

  2. Re: Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’

    I've figured it out after doing some research on the internet and
    looking at the source code....

    There is no function for __gnc_cxx::hash<long long int> defined in ext/
    hash_fun.h !!


    I'm not too sure if this is a very smart idea.... but I added two more
    methods to ext/hash_fun.h... and it successfully built:

    template<>
    struct hash<long long int>
    {
    size_t
    operator()(long long int __x) const
    { return __x; }
    };

    template<>
    struct hash<unsigned long long int>
    {
    size_t
    operator()(unsigned long long int __x) const
    { return __x; }
    };


    I think that there is a reason that the long long int types are not
    supported in gcc. I'm hoping someone can tell me why they are not
    supported and if there is another way besides adding those template
    functions for a hash.

    Also, I would really like someone to tell me if by adding those two
    template functions, I just shot myself in the foot?

    Thanks in advance
     
    veryhotsausage, Jul 4, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timo Freiberger
    Replies:
    3
    Views:
    987
    Bob Hairgrove
    Oct 30, 2004
  2. Schnoffos
    Replies:
    2
    Views:
    1,246
    Martien Verbruggen
    Jun 27, 2003
  3. Hal Styli
    Replies:
    14
    Views:
    1,697
    Old Wolf
    Jan 20, 2004
  4. Replies:
    11
    Views:
    1,143
  5. Steve Hicks
    Replies:
    2
    Views:
    1,299
Loading...

Share This Page