Hi,
I had the same problem with Xcode 3 and boost 1.34.1. 

To fix my problem, I had to uncheck the "recursive" checkbox button in the "Header Search Paths" section of the "Debug" target project settings for the boost header path. Once I unchecked the "recursive" checkbox, I was able to compile my target. 

I hope this helps you.

-- 
-Jaime
http://www.jaimerios.com

On Sat, Feb 23, 2008 at 8:00 PM, Daniel Lord <daniel@brightfire.com> wrote:
This is a specific error with Xcode 3.0 on Leopard not a generic Boost question:
Something is screwy with the paths between Boost and Xcode:

Xcode 3.0 needs to find the Boost includes, so I added my directory containing the top of the Boost tree (the boost_1_34_1 directory) to the User header Search paths in the build configuration for the target. No problem, everything appears to be found.

However, adding that search path screws up something else:

An error pops up in c++locale.h highlighting the line:

   const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);

and claiming: "error: 'snprintf' is not a member of 'std'." What the freak?

It compiles fine from the command line with g++ and using -I<same path to boost as above>. So it is some wierd interaction with Boost and Xcode paths but it make no sense to me. It's almost as if Boost is redefining something. But what?

This does not occur if I don't add the Boost search paths but of course then the Boost definitions are not found.

The program is a simple one from O'Reilly's C+++ Cookbook show below:

#include <boost/filesystem/operations.hpp>

#include <boost/filesystem/fstream.hpp>


#include <iostream>


using namespace boost::filesystem;


int main(int argc, char** argv) {


 if (argc < 2) {

std::cerr << "Usage: " << argv[0] << " [dir name]\n";

return(EXIT_FAILURE);

}

path fullPath =    // Create the full, absolute path name

system_complete(path(argv[1], native));

if (!exists(fullPath)) {

std::cerr << "Error: the directory " << fullPath.string( )

<< " does not exist.\n";

return(EXIT_FAILURE);

}

if (!is_directory(fullPath)) {

std::cout << fullPath.string( ) << " is not a directory!\n";

return(EXIT_SUCCESS);

}

directory_iterator end;

for (directory_iterator it(fullPath);

it != end; ++it) {               // Iterate through each

// element in the dir,

std::cout << it->leaf( );           // almost as you would

if (is_directory(*it))             // an STL container

std::cout << " (dir)";

std::cout << '\n';

}

return(EXIT_SUCCESS);

}


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users