is leaf() be defined at boost/filesystem/operations.hpp ?
Dear advanced boost/c/g++ programers:
I copied and try a simple (Reading a directory with boost) program , from page 383, Example 10-19, of book(C++ cookbook)
----------you can download the code to try by yourself at, http://examples.oreilly.com/9780596007614/
// Example 10-19. Reading a directory
#include <iostream>
#include <cstdlib>
#include
On Wed, Jul 20, 2011 at 06:12:14AM -0700, Eric Lin wrote:
Dear advanced boost/c/g++ programers:
I copied and try a simple (Reading a directory with boost) program , from page 383, Example 10-19, of book(C++ cookbook) Example10-19.cpp:34:24: error: ‘class boost::filesystem3::directory_entry’ has no member named ‘leaf’
I am using 1.46.1 of boost
Note that the error message mentions "filesystem3", which indicate that you are currently using Boost.Filesystem v3. The book is probably written against the old Filesystem v2, which was the default version used up through Boost 1.45.0. You've got two solutions at hand: 1) Define the preprocessor definition shown in the documentation to get v2, but that will stop working when Boost stops shipping v2 (according to the docs, this will be after 1.47). 2) Rewrite the code to use the slightly different interface of v3. http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/index.htm -- Lars Viklund | zao@acc.umu.se
show out general annoucement of transition from v2 to v3 did not help unless point out specific target that my question request and I indeed is hard to find anything related to v3 and leaf in boost.org or google or cplusplus.com so need any expert's help again, Eric ----------------------------------------
Date: Wed, 20 Jul 2011 15:27:35 +0200 From: zao@acc.umu.se To: boost-users@lists.boost.org Subject: Re: [Boost-users] is leaf() be defined at boost/filesystem/operations.hpp ?
On Wed, Jul 20, 2011 at 06:12:14AM -0700, Eric Lin wrote:
Dear advanced boost/c/g++ programers:
I copied and try a simple (Reading a directory with boost) program , from page 383, Example 10-19, of book(C++ cookbook) Example10-19.cpp:34:24: error: ‘class boost::filesystem3::directory_entry’ has no member named ‘leaf’
I am using 1.46.1 of boost
Note that the error message mentions "filesystem3", which indicate that you are currently using Boost.Filesystem v3.
The book is probably written against the old Filesystem v2, which was the default version used up through Boost 1.45.0.
You've got two solutions at hand:
1) Define the preprocessor definition shown in the documentation to get v2, but that will stop working when Boost stops shipping v2 (according to the docs, this will be after 1.47).
2) Rewrite the code to use the slightly different interface of v3.
http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/index.htm
-- Lars Viklund | zao@acc.umu.se _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I suppose that Lars did help you. See http://www.boost.org/doc/libs/1_47_0/libs/filesystem/v3/doc/deprecated.html for differences between v2 and v3. You can see for yourself that 'leaf' has been removed from v3 which is currently the default using Boost.FileSystem.
participants (3)
-
Eric Lin
-
gast128
-
Lars Viklund