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 const&, boost::system::error_code&)",
referenced from:
boost::enable_if,
boost::filesystem2::path_traits> >, bool>::type boost::filesystem2::exists<
boost::filesystem2::basic_path, boost::filesystem2::path_traits> >(
boost::filesystem2::basic_path, 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