can't initialize boost::filesystem::path
Dear boot users, 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, size_type _Newsize = 0) { // initialize buffer, deallocating any storage if (!_Built) ; else if (_BUF_SIZE <= _Myres) { // copy any leftovers to small buffer and deallocate _Elem *_Ptr = _Bx._Ptr; if (0 < _Newsize) _Traits::copy(_Bx._Buf, _Ptr, _Newsize); _Mybase::_Alval.deallocate(_Ptr, _Myres + 1); } _Myres = _BUF_SIZE - 1; _Eos(_Newsize); }
Any help is welcome. Thanks in advance !
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.
Thanks a lot. This solves the problem On Mon, Nov 10, 2008 at 3:26 PM, Eric MALENFANT < Eric.Malenfant@sagem-interstar.com> wrote:
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
ahassaine@gmail.com
-
Eric MALENFANT