我正在开发代理建模项目,并决定使用该工具。 我已经预先安装了一堆库,并下载了重新启动源,并试图将其包含在项目中。但突然出现我无法理解的错误。C++编译错误(REPAST库)
error: no match for ‘operator+’ in ‘std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*) [with _CharT = char, _Traits = std::char_traits, _Alloc = std::allocator](((const char*)"_")) + boost::filesystem3::path::filename() const()’
CODE:
NCDataSet::NCDataSet(std::string file, const Schedule& schedule) :
file_(file), schedule_(&schedule), start(0), open(true)
{
rank = RepastProcess::instance()->rank();
if (rank == 0) {
fs::path filepath(file);
if (!fs::exists(filepath.parent_path())) {
fs::create_directories(filepath.parent_path());
} else if (fs::exists(filepath)) {
string ts;
repast::timestamp2(ts);
fs::path to(filepath.parent_path()/(ts + "_" + filepath.filename()));
fs::rename(filepath, to);
}
}
}
ERROR LINE: fs::path to(filepath.parent_path()/(ts + "_" + filepath.filename()));
谢谢!
是唯一的错误?如果没有,你可以发布完整的编译器输出吗? – hmjd 2012-02-20 22:03:17