Complier errors using property_tree 5 minute tutorial
Hello Users, I am using boost 1.47.0's property_tree on Windows 7 x64 using the Intel Compiler v 12.0.1029.2010 and having followed the 5 Minute Tutorial to the letter I get errors at complie time. This is my header file : #ifndef INFOSTRUCT_HPP #define INFOSTRUCT_HPP #include <string> struct INFO { unsigned m_Type ; std::string m_Desc ; std::string m_User ; std::string m_Pass ; std::string m_Server ; void load(const std::string & fileName) ; void save(const std::string & fileName) ; } ; #endif // INFOSTRUCT_HPP and this is the .cpp file: #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> #include "infoStruct.hpp" void INFO::load(const std::string &fileName) { boost::property_tree::ptree pTree ; boost::property_tree::xml_parser::read_xml(fileName, pTree) ; m_Type = pTree.get("Database.Driver", 0) ; m_Pass = pTree.get < std::string>("Database.Pass") ; } void INFO::save(const std::string &fileName) { return ; } But when I compile this I get lots and lots of compiler errors this most significant of those being: ..\..\Includes\boost/property_tree/detail/ptree_implementation.hpp(52): error #501: argument of type "const std::string std::_Pair_base<const std::string, boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string>>>::*" is incompatible with template parameter of type "const std::string std::pair<const std::string, boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string>>>::*" &value_type::first>, ^ detected during: instantiation of class "boost::property_tree::basic_ptree<Key, Data, KeyCompare>::subs [with Key=std::string, Data=std::string, KeyCompare=std::less<std::string>]" at line 182 instantiation of "boost::property_tree::basic_ptree<Key, Data, KeyCompare>::basic_ptree() [with Key=std::string, Data=std::string, KeyCompare=std::less<std::string>]" at line 8 of "..\DataFactory\infoStruct.cpp" With the line in question being : boost::property_tree::ptree pTree ; I honestly cannot see where or what I am doing wrong, so I am hoping someone here can help me. -- Bill
On 08/14/2011 12:54 PM, Bill Moo wrote:
Hello Users,
I am using boost 1.47.0's property_tree on Windows 7 x64 using the Intel Compiler v 12.0.1029.2010 and having followed the 5 Minute Tutorial to the letter I get errors at complie time.
This is due to a bug in VC++'s standard library. There is a workaround, but it's conditioned on specific versions of the Microsoft compiler, so when you use Intel's, the workaround isn't used. There should be an #ifdef at the line the error points to. Make it unconditional, and it should work. Sebastian
On Sun, Aug 14, 2011 at 2:43 PM, Sebastian Redl < sebastian.redl@getdesigned.at> wrote:
On 08/14/2011 12:54 PM, Bill Moo wrote:
Hello Users,
I am using boost 1.47.0's property_tree on Windows 7 x64 using the Intel Compiler v 12.0.1029.2010 and having followed the 5 Minute Tutorial to the letter I get errors at complie time.
This is due to a bug in VC++'s standard library. There is a workaround, but it's conditioned on specific versions of the Microsoft compiler, so when you use Intel's, the workaround isn't used. There should be an #ifdef at the line the error points to. Make it unconditional, and it should work.
Hello Sebastian,
I did as you suggested by commenting out the #if and #endif in the property_tree/detail/ptree_implementation.hpp file leaving BOOST_PROPERTY_TREE_PAIR_BUG and as expected this error went away. However, I now get errors regarding ..\..\Includes\boost/multi_index_container.hpp(487): warning #583: C++ exception handler found but /EHsc option was not specified BOOST_TRY{ ... -- Bill
On Sun, Aug 14, 2011 at 3:43 PM, Bill Moo <cppsysdev@gmail.com> wrote:
On Sun, Aug 14, 2011 at 2:43 PM, Sebastian Redl < sebastian.redl@getdesigned.at> wrote:
On 08/14/2011 12:54 PM, Bill Moo wrote:
Hello Users,
I am using boost 1.47.0's property_tree on Windows 7 x64 using the Intel Compiler v 12.0.1029.2010 and having followed the 5 Minute Tutorial to the letter I get errors at complie time.
This is due to a bug in VC++'s standard library. There is a workaround, but it's conditioned on specific versions of the Microsoft compiler, so when you use Intel's, the workaround isn't used. There should be an #ifdef at the line the error points to. Make it unconditional, and it should work.
Hello Sebastian,
However, I now get errors regarding ..\..\Includes\boost/multi_index_container.hpp(487): warning #583: C++ exception handler found but /EHsc option was not specified
BOOST_TRY{ ...
HI, I've enabled exception handling in the .pro file and this has of course cleared this issue, but I now get warnings, here's an example of one: infoStruct.cpp ..\..\Includes\boost/mpl/aux_/has_begin.hpp(20): warning #2586: 'test' : decorated name length exceeded, name was truncated BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_begin, begin, true) Any suggestions would be appreciated. -- Bill
On 14.08.2011 17:35, Bill Moo wrote:
I've enabled exception handling in the .pro file and this has of course cleared this issue, but I now get warnings, here's an example of one: infoStruct.cpp
..\..\Includes\boost/mpl/aux_/has_begin.hpp(20): warning #2586: 'test' : decorated name length exceeded, name was truncated
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_begin, begin, true)
Any suggestions would be appreciated.
Hi, I suggest you start a new thread with a new subject for that. Sebastian
participants (2)
-
Bill Moo
-
Sebastian Redl