Boost logo

Boost Users :

Subject: Re: [Boost-users] Updating filesystem to V3 (boost 1.49)
From: Lars Viklund (zao_at_[hidden])
Date: 2012-05-06 13:25:19


On Sun, May 06, 2012 at 12:46:45PM -0400, Shai Shasag wrote:
> I'm in the process of updating my code to use filesystem V3. I replaced all the V2 deprecated functions with V3 calls. I defined the macros:
> BOOST_FILESYSTEM_VERSION=3
> BOOST_FILESYSTEM_NO_DEPRECATED
>
> When compiling the file libs/filesystem/v3/src/path.cpp I get the following error:
>
> #error both BOOST_FILESYSTEM_DEPRECATED and BOOST_FILESYSTEM_NO_DEPRECATED are defined
>
> The reason for this error is that in filesystem/v3/config.hpp has the following:
>
> // BOOST_FILESYSTEM_DEPRECATED needed for source compiles
> # ifdef BOOST_FILESYSTEM_SOURCE
> # define BOOST_FILESYSTEM_DEPRECATED
> # endif
>
> So i'm puzzled as to why BOOST_FILESYSTEM_DEPRECATED is forced when compiling path.cpp? And how can I avoid theses erros when compiling filesystem V3?

Those macros are for building your source code that uses
Boost.Filesystem, not for influencing the build of Filesystem itself.

The build of Boost.Filesystem itself builds all the Filesystem versions
into a single library, including any deprecated functions, and there's
no way to affect that.

The macros are for configuring the interface that your code sees, not
the symbols that exist in the libraries.

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net