On 14/1/10 20:26, Krzysztof Kosiński wrote:
W dniu 14 stycznia 2010 20:06 użytkownik ~suv <suv-sf@...58...> napisał:
using the second example from the 3rd answer (Hash Tables): (snip)
The example should compile without any special flags or other magic. It is definitely a bug in the <tr1/unordered_set> header. You'll have to upgrade to a version of GCC that has a working header. I don't think I can fix this (short of not using unordered_set at all).
I have the most up-to-date version of Xcode (3.1.4) installed. Changing from gcc 4.0.1 to 4.2 still doesn't compile the hash-tables test.
LeWitt:lists suv$ echo $CC $CXX /usr/bin/gcc-4.2 /usr/bin/g++-4.2 LeWitt:lists suv$ make hash-tables /usr/bin/g++-4.2 hash-tables.cpp -o hash-tables /usr/include/c++/4.0.0/tr1/hashtable: In copy constructor ‘std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::hashtable(const std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>&) [with Key = int, Value = int, Allocator = std::allocator<int>, ExtractKey = Internal::identity<int>, Equal = std::equal_to<int>, H1 = std::tr1::hash<int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool mutable_iterators = false, bool unique_keys = true]’: /usr/include/c++/4.0.0/tr1/unordered_set:56: instantiated from here /usr/include/c++/4.0.0/tr1/hashtable:1045: error: invalid conversion from ‘Internal::hash_node<int, false>*’ to ‘int’ /usr/include/c++/4.0.0/tr1/hashtable:1045: error: initializing argument 1 of ‘typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::node* std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::m_allocate_node(const Value&) [with Key = int, Value = int, Allocator = std::allocator<int>, ExtractKey = Internal::identity<int>, Equal = std::equal_to<int>, H1 = std::tr1::hash<int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool mutable_iterators = false, bool unique_keys = true]’ /usr/include/c++/4.0.0/tr1/unordered_set:56: instantiated from here /usr/include/c++/4.0.0/tr1/hashtable:1046: error: request for member ‘copy_code_from’ in ‘* tail’, which is of non-class type ‘Internal::hash_node<int, false>*’ /usr/include/c++/4.0.0/tr1/hashtable: In member function ‘typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::const_iterator std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::find(const Key&) const [with Key = int, Value = int, Allocator = std::allocator<int>, ExtractKey = Internal::identity<int>, Equal = std::equal_to<int>, H1 = std::tr1::hash<int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool mutable_iterators = false, bool unique_keys = true]’: hash-tables.cpp:29: instantiated from here /usr/include/c++/4.0.0/tr1/hashtable:1135: error: passing ‘const std::tr1::hashtable<int, int, std::allocator<int>, Internal::identity<int>, std::equal_to<int>, std::tr1::hash<int>, Internal::mod_range_hashing, Internal::default_ranged_hash, Internal::prime_rehash_policy, false, false, true>’ as ‘this’ argument of ‘typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::node* std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::find_node(Internal::hash_node<Value, cache_hash_code>*, const Key&, typename std::tr1::hashtable<Key, Value, Allocator, ExtractKey, Equal, H1, H2, H, RehashPolicy, cache_hash_code, mutable_iterators, unique_keys>::hash_code_t) [with Key = int, Value = int, Allocator = std::allocator<int>, ExtractKey = Internal::identity<int>, Equal = std::equal_to<int>, H1 = std::tr1::h
ash<int>, H2 = Internal::mod_range_hashing, H = Internal::default_ranged_hash, RehashPolicy = Internal::prime_rehash_policy, bool cache_hash_code = false, bool mutable_iterators = false, bool unique_keys = true]’ discards qualifiers
make: *** [hash-tables] Error 1 LeWitt:lists suv$ ll /usr/include/c++/ total 0 drwxr-xr-x 67 root wheel 2278 Oct 24 01:07 4.0.0/
Still need to confirm whether I need additional configuration other than setting $CC and $CXX to use g++-4.2:
LeWitt:lists suv$ which g++-4.2 /usr/bin/g++-4.2 LeWitt:lists suv$ g++-4.2 --version i686-apple-darwin9-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I can't yet believe that Inkscape will no longer support building with Apple's current Xcode developer tools on OS X Leopard...
:(
~suv