當我嘗試編譯此代碼: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