Compile error using property_tree

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Compile error using property_tree

Boost - Users mailing list
Hello guys,
I wanted to use boost to parse an INI file. in my code i used this includes:
#include "boost/property_tree/ptree.hpp"
#include "boost/property_tree/ini_parser.hpp"

when I compile my code "g++ test.cpp -o Test" with only this two includes I get an error from one of the included files:

In file included from test.cpp:15:0:
boost/property_tree/ptree.hpp:15:45: fatal error: boost/property_tree/ptree_fwd.hpp: File or directory not found
 #include <boost/property_tree/ptree_fwd.hpp>
                                             ^
compilation terminated.


This is an error in the ptree.hpp imported file. Maybe this has a quick fix but I'm kinda new to C++. I've checked and both files exist (boost/property_tree/ptree and boost/property_tree/ptree_fwd.hpp).

Thanks,
Rui




_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Compile error using property_tree

Boost - Users mailing list
On 9/10/2019 7:00 AM, Rui Pedro via Boost-users wrote:

> Hello guys,
> I wanted to use boost to parse an INI file. in my code i used this includes:
> #include "boost/property_tree/ptree.hpp"
> #include "boost/property_tree/ini_parser.hpp"
>
> when I compile my code "g++ test.cpp -o Test" with only this two
> includes I get an error from one of the included files:
>
> In file included from test.cpp:15:0:
> boost/property_tree/ptree.hpp:15:45: fatal error:
> boost/property_tree/ptree_fwd.hpp: File or directory not found
>   #include <boost/property_tree/ptree_fwd.hpp>
>                                               ^
> compilation terminated.
>
>
> This is an error in the ptree.hpp imported file. Maybe this has a quick
> fix but I'm kinda new to C++. I've checked and both files exist
> (boost/property_tree/ptree and boost/property_tree/ptree_fwd.hpp).

You need an "-Itop-level-boost-directory" parameter.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Compile error using property_tree

Boost - Users mailing list
What do you mean? Can you be more specific? I am new to C++ and new to nonstandard libraries of the programming languages.

De: Boost-users <[hidden email]> em nome de Edward Diener via Boost-users <[hidden email]>
Enviado: 10 de setembro de 2019 15:59
Para: [hidden email] <[hidden email]>
Cc: Edward Diener <[hidden email]>
Assunto: Re: [Boost-users] Compile error using property_tree
 
On 9/10/2019 7:00 AM, Rui Pedro via Boost-users wrote:
> Hello guys,
> I wanted to use boost to parse an INI file. in my code i used this includes:
> #include "boost/property_tree/ptree.hpp"
> #include "boost/property_tree/ini_parser.hpp"
>
> when I compile my code "g++ test.cpp -o Test" with only this two
> includes I get an error from one of the included files:
>
> In file included from test.cpp:15:0:
> boost/property_tree/ptree.hpp:15:45: fatal error:
> boost/property_tree/ptree_fwd.hpp: File or directory not found
>   #include <boost/property_tree/ptree_fwd.hpp>
>                                               ^
> compilation terminated.
>
>
> This is an error in the ptree.hpp imported file. Maybe this has a quick
> fix but I'm kinda new to C++. I've checked and both files exist
> (boost/property_tree/ptree and boost/property_tree/ptree_fwd.hpp).

You need an "-Itop-level-boost-directory" parameter.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Compile error using property_tree

Boost - Users mailing list
On 9/10/2019 12:26 PM, Rui Pedro via Boost-users wrote:
> What do you mean? Can you be more specific? I am new to C++ and new to
> nonstandard libraries of the programming languages.

Please do not top post.

The -I option sets the include path. If you set it to the directory
where Boost is installed on your system, then Boost header files will be
found, since all Boost header files are of the form of:

#include <boost/some_path/some_headerfile.hpp>

the 'boost' subdirectory ( and its subdirectories ) for each
distribution is where the Boost header files reside.

> ------------------------------------------------------------------------
> *De:* Boost-users <[hidden email]> em nome de
> Edward Diener via Boost-users <[hidden email]>
> *Enviado:* 10 de setembro de 2019 15:59
> *Para:* [hidden email] <[hidden email]>
> *Cc:* Edward Diener <[hidden email]>
> *Assunto:* Re: [Boost-users] Compile error using property_tree
> On 9/10/2019 7:00 AM, Rui Pedro via Boost-users wrote:
>> Hello guys,
>> I wanted to use boost to parse an INI file. in my code i used this includes:
>> #include "boost/property_tree/ptree.hpp"
>> #include "boost/property_tree/ini_parser.hpp"
>>
>> when I compile my code "g++ test.cpp -o Test" with only this two
>> includes I get an error from one of the included files:
>>
>> In file included from test.cpp:15:0:
>> boost/property_tree/ptree.hpp:15:45: fatal error:
>> boost/property_tree/ptree_fwd.hpp: File or directory not found
>>   #include <boost/property_tree/ptree_fwd.hpp>
>>                                               ^
>> compilation terminated.
>>
>>
>> This is an error in the ptree.hpp imported file. Maybe this has a quick
>> fix but I'm kinda new to C++. I've checked and both files exist
>> (boost/property_tree/ptree and boost/property_tree/ptree_fwd.hpp).
>
> You need an "-Itop-level-boost-directory" parameter.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users