I am trying to use boost/property_tree/ptree.hpp in my application. All I
have done so far is just add the following include statements to my program:
#include
#include
After adding these lines, I compiled my modified application using g++
4.6.3 on Ubuntu 12.04. I get the following errors:
g++ -c -Wall -Werror -I../cudd-2.4.2//include/ -I
/home/pramod/libraries/boost_1_50_0/ -O2 -Wno-unused-result
-Wno-unused-function -c -o main.o main.cpp
In file included from
/home/pramod/libraries/boost_1_50_0/boost/property_tree/ptree.hpp:17:0,
from main.h:10,
from main.cpp:17:
/home/pramod/libraries/boost_1_50_0/boost/property_tree/stream_translator.hpp:
In static member function ‘static void
boost::property_tree::customize_stream::extract(std::basic_istream<_CharT, _Traits>&, bool&)’:
/home/pramod/libraries/boost_1_50_0/boost/property_tree/stream_translator.hpp:117:18:
error: expected unqualified-id before ‘{’ token
/home/pramod/libraries/boost_1_50_0/boost/property_tree/stream_translator.hpp:117:18:
error: expected ‘)’ before ‘{’ token
/home/pramod/libraries/boost_1_50_0/boost/property_tree/stream_translator.hpp:
In member function ‘boost::optional<E>
boost::property_tree::stream_translator::get_value(const internal_type&)’:
/home/pramod/libraries/boost_1_50_0/boost/property_tree/stream_translator.hpp:191:20:
error: expected unqualified-id before ‘{’ token
/home/pramod/libraries/boost_1_50_0/boost/property_tree/stream_translator.hpp:191:20:
error: expected ‘)’ before ‘{’ token
make: *** [main.o] Error 1
When I look the lines117 and 191 in ptree.hpp, they are the following:
s >> e;
if(s.fail()) {
// Try again in word form.
and
customized::extract(iss, e);
if(iss.fail() || iss.bad() || iss.get() != Traits::eof()) {
return boost::optional<E>();
I can't spot anything obviously wrong with either of these lines.
Does anyone have any clues on what could be going wrong?
Thanks!
Pramod