Boost logo

Boost :

From: Sebastien Mirolo (smirolo_at_[hidden])
Date: 2006-04-17 17:51:50


Hi,

I was trying to use the boost::filesystem::path class (from
boost_1_33_1) and surprisingly, the following little piece of code
just asserts:

/* g++ -v -I${HOME}/installed/local/include -L${HOME}/installed/local/
lib \
      -o boost boost.cc -lboost_filesystem
*/

#include <boost/filesystem/path.hpp>

int main( int argc, char *argv[] ) {
   boost::filesystem::path p("/usr/include/c++/4.0.0/cstring");
   return 0;
}

Bahia:bugs$ ./boost
terminate called after throwing an instance of
'boost::filesystem::filesystem_error'
   what(): boost::filesystem::path: invalid name "c++" in path: "/
usr/include/c++/4.0.0/cstring"
Abort trap
Bahia:bugs$

Is there any reason why I couldn't construct a path like this? I was
just trying to access a file in the default include directory of the
gcc install on Mac OSX 10.4.

Thank you,
Sebastien.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk