我正在尝试构建一个程序,但得到了一个错误:
application_ob.cpp: In member function 'void ApplicationWindow::OBNewLoad(QString, QString)':
application_ob.cpp:103:41: error: call of overloaded 'FormatFromExt(QString&)' is ambiguous
application_ob.cpp:103:41: note: candidates are:
/usr/include/openbabel-2.0/openbabel/obconversion.h:81:24: note: static OpenBabel::OBFormat* OpenBabel::OBConversion::FormatFromExt(const char*)
/usr/include/openbabel-2.0/openbabel/obconversion.h:84:24: note: static OpenBabel::OBFormat* OpenBabel::OBConversion::FormatFromExt(std::string)我如何修补它才能得到正常的构建?因为我不知道C++,所以请用简单的方式解释。
发布于 2011-07-15 17:10:11
application_ob.cpp的第103行可能是这样的:
FormatFromExt(qs);直接的解决方案是将此(或其等效项)更改为
FormatFromExt(qs.toStdString());但是,关于qs的可能内容,我们没有足够的信息来判断上面的方法在处理非拉丁字符时是否有效。this answer中提供了更好的替代方案,但要在它们之间进行选择,我们必须知道我们正在处理的是哪种数据。
https://stackoverflow.com/questions/6704800
复制相似问题