当我尝试编译此代码:boost :: filesystem中的错误,这可能吗?
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
using namespace std;
int main()
{
boost::filesystem3::path file_path("C:\\Users\\Art\\Desktop\\ASO.sln");
boost::filesystem3::path new_path(file_path.begin(),file_path.end() - 1);
return 0;
}
我得到一个错误:
C:\Users\Me\boost_path\..\..\..\boost_148\include\boost-1_48\boost\filesystem\v3\path.hpp:163: error: no matching function for call to 'convert(const boost::filesystem3::path*, const boost::filesystem3::path*, boost::filesystem3::path::string_type&, const codecvt_type&)'
为什么?我认为在boost::filesystem
有一个错误。
**总是**首先假定错误在_your_代码中。偶尔,你会错的,但通常这是正确的。 – 2012-02-25 21:23:32
那么'#include'而不是单独的所有这些文件呢? –
2012-02-25 21:44:39
@daknøk:因为他不想*包含所有内容。如果他不使用'directory_iterator',那么为什么浪费编译器的时间来包含它们呢? – 2012-02-25 23:36:17