Boost logo

Boost Users :

Subject: Re: [Boost-users] can't initialize boost::filesystem::path
From: Eric MALENFANT (Eric.Malenfant_at_[hidden])
Date: 2008-11-10 09:26:19


ahassaine, le 8 novembre 2008 08:12:
>
> I'm using boost 1.33 with Visual C++ 7.
> I need to create an instance of boost::filesystem::path.
> I tried :
>
>
> std::string dir="c:\\";
> boost::filesystem::path my_path(dir);
>
> The compilation is successful but at the execution, I obtain
> a non handled exception in the xstring file at the end of this
> function :
>
>
> void _Tidy(bool _Built = false,
[snip]

I don't see how the following explains an exception in this function, but anyways, in case it helps:

IIRC, the Filesystem library in 1.33 was "strict" by default, meaning that you could not construct a path from a non-portable syntax like the "c:\" you show above. To use such non-portable paths, you had to explicitely say so, by passing the "native" flag to the ctor. See http://groups.google.ca/group/comp.lang.c++.moderated/msg/69fdb04bca3ab4de

Éric Malenfant
---------------------------------------------
Perperam eventurum est quicquid perperam evenire potest.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net