GNOME Bugzilla – Bug 733085
Fail to build nemiver on FreeBSD with clang and libc++ because of std::tr1
Last modified: 2016-11-03 17:34:45 UTC
FreeBSD 10.0 (or later version) uses clang and libc++ as default compiler and C++ standard library, instead of gcc and libstdc++. However, libc++ does not have std::tr1. It supports C++11 things. For example, libc++ does not have <tr1/unordered_map>, but it have it has <unordered_map>. gmake[3]: Entering directory `/home/lantw44/gnome/source/nemiver/src/common' CXX nmv-log-stream.lo nmv-log-stream.cc:70:14: error: no member named 'tr1' in namespace 'std' typedef std::tr1::unordered_map<std::string, bool> DomainMap; ~~~~~^ nmv-log-stream.cc:252:45: error: read-only variable is not assignable allowed_domains[NMV_GENERAL_DOMAIN] = true; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ nmv-log-stream.cc:279:28: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union if (allowed_domains.find ("all") == allowed_domains.end ()) { ~~~~~~~~~~~~~~~^~~~~ nmv-log-stream.cc:279:60: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union if (allowed_domains.find ("all") == allowed_domains.end ()) { ~~~~~~~~~~~~~~~^~~~ nmv-log-stream.cc:280:32: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union if (allowed_domains.find (a_domain.c_str ()) == allowed_domains.end ()) { ~~~~~~~~~~~~~~~^~~~~ nmv-log-stream.cc:280:76: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union if (allowed_domains.find (a_domain.c_str ()) == allowed_domains.end ()) { ~~~~~~~~~~~~~~~^~~~ nmv-log-stream.cc:408:52: error: read-only variable is not assignable m_priv->allowed_domains[a_domain.c_str ()] = true; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ nmv-log-stream.cc:410:32: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union m_priv->allowed_domains.erase (a_domain.c_str ()); ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ nmv-log-stream.cc:417:32: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union if (m_priv->allowed_domains.find (a_domain.c_str ()) ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ nmv-log-stream.cc:418:35: error: member reference base type 'DomainMap' (aka 'int') is not a structure or union != m_priv->allowed_domains.end ()) { ~~~~~~~~~~~~~~~~~~~~~~~^~~~ 10 errors generated. gmake[3]: *** [nmv-log-stream.lo] Error 1 gmake[3]: Leaving directory `/home/lantw44/gnome/source/nemiver/src/common'
Created attachment 338807 [details] [review] Proposed patch Proposed patch to remove all tr1 since c++11 is now required.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version. commit bd59adfb0821461b829740d4a8d1e7c5ea895cb5
Please let us know if you encounter more problems building it.
Thanks for fixing this issue. Nemiver can be built on FreeBSD 11 with clang 3.8 now.