$ g++ -std=c++0x T1.cpp -lcryptopp -o T1 In file included from /usr/include/boost/property_tree/json_parser.hpp:17, from T1.cpp:6: /usr/include/boost/property_tree/json_parser/detail/write.hpp: In instantiation of ‘void boost::property_tree::json_parser::write_json_helper(std::basic_ostream&, const Ptree&, int, bool) [with Ptree = boost::property_tree::basic_ptree, CryptoPP::AllocatorWithCleanup >, std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >, std::less, CryptoPP::AllocatorWithCleanup > > >; typename Ptree::key_type::value_type = char; typename Ptree::key_type::value_type = char]’: /usr/include/boost/property_tree/json_parser/detail/write.hpp:160:26: required from ‘void boost::property_tree::json_parser::write_json_internal(std::basic_ostream&, const Ptree&, const string&, bool) [with Ptree = boost::property_tree::basic_ptree, CryptoPP::AllocatorWithCleanup >, std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >, std::less, CryptoPP::AllocatorWithCleanup > > >; typename Ptree::key_type::value_type = char; typename Ptree::key_type::value_type = char; std::string = std::__cxx11::basic_string]’ /usr/include/boost/property_tree/json_parser.hpp:99:28: required from ‘void boost::property_tree::json_parser::write_json(std::basic_ostream&, const Ptree&, bool) [with Ptree = boost::property_tree::basic_ptree, CryptoPP::AllocatorWithCleanup >, std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >, std::less, CryptoPP::AllocatorWithCleanup > > >; typename Ptree::key_type::value_type = char; typename Ptree::key_type::value_type = char]’ ################# SEE HERE ##################### T1.cpp:33:46: required from here /usr/include/boost/property_tree/json_parser/detail/write.hpp:84:48: error: cannot convert ‘Str’ {aka ‘std::__cxx11::basic_string’} to ‘const key_type&’ {aka ‘const std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >&’} 84 | else if (indent > 0 && pt.count(Str()) == pt.size()) In file included from /usr/include/boost/property_tree/ptree.hpp:516, from T1.cpp:5: /usr/include/boost/property_tree/detail/ptree_implementation.hpp:518:53: note: initializing argument 1 of ‘boost::property_tree::basic_ptree::size_type boost::property_tree::basic_ptree::count(const key_type&) const [with Key = std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >; Data = std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >; KeyCompare = std::less, CryptoPP::AllocatorWithCleanup > >; boost::property_tree::basic_ptree::size_type = long unsigned int; boost::property_tree::basic_ptree::key_type = std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >]’ 518 | basic_ptree::count(const key_type &key) const | ~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/boost/property_tree/json_parser.hpp:17, from T1.cpp:6: ################# AND HERE ##################### /usr/include/boost/property_tree/json_parser/detail/write.hpp:111:52: error: no matching function for call to ‘create_escapes(const std::__cxx11::basic_string, CryptoPP::AllocatorWithCleanup >&)’ 111 | stream << Ch('"') << create_escapes(it->first) << Ch('"') << Ch(':'); | ~~~~~~~~~~~~~~^~~~~~~~~~~ /usr/include/boost/property_tree/json_parser/detail/write.hpp:25:27: note: candidate: ‘template std::__cxx11::basic_string<_CharT> boost::property_tree::json_parser::create_escapes(const std::__cxx11::basic_string<_CharT>&)’ 25 | std::basic_string create_escapes(const std::basic_string &s) | ^~~~~~~~~~~~~~ /usr/include/boost/property_tree/json_parser/detail/write.hpp:25:27: note: template argument deduction/substitution failed: /usr/include/boost/property_tree/json_parser/detail/write.hpp:111:52: note: mismatched types ‘std::allocator<_CharT>’ and ‘CryptoPP::AllocatorWithCleanup’ 111 | stream << Ch('"') << create_escapes(it->first) << Ch('"') << Ch(':'); | ~~~~~~~~~~~~~~^~~~~~~~~~~