Updating filesystem to V3 (boost 1.49)

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? Thanks Shai Boost version: 1.49 Compiler: gcc version 4.2.1, Xcode 3.2.5 on Mac OS 10.6.8

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@acc.umu.se
participants (2)
-
Lars Viklund
-
Shai Shasag