tags:

views:

42

answers:

1

Hello, I'm using boost::ptree for parsing fils. The problem is that I can't create the object in the heap. All samples is only for stack.

#include <boost/property_tree/ptree.hpp>
ptree *tree_handle;
read_info("path", tree_handle);

I need this because the code is in a function and I have to return the ptree-object from it.

Errors:

‘boost::property_tree::basic_ptree<std::basic_string<char>, std::basic_string<char> >*’ is not a class, struct, or union type

request for member ‘swap’ in ‘pt’, which is of non-class type ‘boost::property_tree::basic_ptree<std::basic_string<char>, std::basic_string<char> >*’

Any ideas?

A: 

From what I can see, ptree does not seems to be recognized, are you sure the #include is alright or that ptree is realy what you meant?

Drahakar
Yes, when I'm trying to make it in the stack `ptree tree_handle` everything works.
Ockonal