boost::filesystem::path(std::wstring) throw exception
this code:
boost::filesystem::is_directory("/usr/include");
work fine.
both this code:
boost::filesystem::is_directory(L"/usr/include");
throw an exception:
开发者_Go百科terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
OS - Linux Mint
boost-1.43
gcc-4.6.0
- Don't use wide strings on Linux. You don't need them..
What happens that it tries to convert wide string to normal one and for this creates a locale and probably this locale is not configured in your system.
Bring output of commands:
locale locale -a
- GCC-4.6 wasn't released yet
;-)
, check if this works with ordinary compiler. Probably libstdc++ wasn't build well.
精彩评论