-1
这不是我写的一些旧的代码。它使用GCC 3.4.6进行编译,但现在我们正在使用GCC 4.4.7检查构建,并且构建失败。C++ find命令不再起作用
我希望这个代码是足够去:
list<Chapter*> * tocP; //Chapter is a class
tocP = NULL;
if (_searchChapter)
{
_chapter = _manager->GetCurrentChapter(); // _chapter is a Chapter*
}
else
{
tocP = _manager->GetTableOfContents();
if (tocP != NULL && tocP->size() > 0)
_chapter = tocP->front();
}
...
list<Chapter*>::iterator chp;
if (tocP != NULL && tocP->size() > 0)
for (chp=find(tocP->begin(),tocP->end(),_chapter); chp != tocP->end(); ++chp) // this code fails
{
//code to process chapter
}
错误消息:
../src/HelpSearchC.C:在成员函数 '廉政HelpSearchC_i :: DoSearch()' : ../src/HelpSearchC.C:685:错误:没有匹配函数调用 '找到(STD :: _ List_iterator <章* >, 的std :: _ List_iterator <章* >,章* &)'
你有没有'#包括'? –
lllllllllll
那么这是肯定快!非常感谢。问题没有了。 – geoffw35
因此,GCC 3.4.6只是在找到算法的定义时不需要#include? –
geoffw35