boost.filesystem create_directories throws std::bad_alloc

后端 未结 2 840
野的像风
野的像风 2021-01-19 02:30

I have a Visual Studio 2008 C++03 application using Boost 1.47.0 running in Windows XP SP3.

The call boost::filesystem::create_directories( L\"c:\\\\foo\\\\bar

2条回答
  •  臣服心动
    2021-01-19 03:06

    This problem smells like a mismatch in _SECURE_SCL (or maybe the somewhat related _HAS_ITERATOR_DEBUGGING - but I doubt the latter, since the call stack indicates a non-debug build). See https://stackoverflow.com/a/6104239/12711 for some info and make sure _SECURE_SCL is defined the same way in the builds for test.exe and the boost filesystem library linked in.

    AFAIK, boost will use the VC default (which is _SECURE_SCL=1 even in release builds for VS2008), so if you're setting _SECURE_SCL=0 that may be the problem.

提交回复
热议问题