Hi Nicolas,

It's my first time using Boost, but i think you missed the build steps. The Boost library is header-only, except this parts:

http://www.boost.org/doc/libs/1_46_0/more/getting_started/unix-variants.html#header-only-libraries

For example, i'm using Boost.MPI and Boost.Random, my bootstrap.sh call is something like:

./bootstrap.sh --prefix=/your/desired/path --with-libraries=mpi,random

I think you need to pass Filesystem to bootstrap.sh before anything. Also is a good idea read it's docs, because maybe you will need to edit some specific configuration files like i did in Boost.MPI.

Regards,
Jślio.

2011/2/23 Nicolas Chaumont <nicolas.chaumont@gmail.com>
Hello and thank you for reign my post,

When I want to compile the program:

#include "boost/filesystem.hpp"

int main(int argc, char** argv)
{
    boost::filesystem::path path;
    boost::filesystem::exists(path); //<=This is the line that causes the error

    return 0;
}

I get the following error:

"boost::filesystem2::detail::status_api(std::basic_string<char, std::char_traits
<char>, std::allocator<char> > const&, boost::system::error_code&)", 

referenced from:

boost::enable_if<boost::filesystem2::is_basic_path<boost::filesystem2::basic_pat
h<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, 
boost::filesystem2::path_traits> >, bool>::type boost::filesystem2::exists<
boost::filesystem2::basic_path<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, boost::filesystem2::path_traits> >(
boost::filesystem2::basic_path<std::basic_string<char, std::char_traits<char>, 
std::allocator<char> >, boost::filesystem2::path_traits> const&)in main.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

I'm using XCode 3.2.4, Darwin GCC 4.2 with the Mac OSX 10.6 SDK. The program 
links against the libboost_system.a and libboost_filesystem.a libraries from 
Boost 1.45, both compiled with the same compiler.
Boost was compiled in the most straight forward way, i.e. from the boost root 
directory, I invoke the only two commands:

./bootstrap.sh

make

Note that I haven't installed the library in /usr/local.

Since the example compiles fine with the problematic line commented out, 
I assume the include path is correct, and that the linker found 
libboost_system.a (in stage/lib). I also made sure there are no other versions 
of boost present on my computer to eliminate the possibility of a header/library 
version mismatch.

Also, I've tried to compile with different architectures, both in debug and 
release mode. I couldn't remove this error.

I looked for the missing symbol in both libboost_system.a and 
libboost_filesystem.a (nm -m <library name> | c++filt), and the filesystem2 
namespace doesn't exist.

My understanding is that the boost::filesystem2 namespace was never generated 
when I compiled the libraries, but for some reason is generated when I compile 
my little program. So I suppose there might be a definition that triggers or 
prevents this namespace from being created.

Anyone has an idea about what should I do to remove my error?

Thank you in advance,

Regards,
Nicolas


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