我是 Borland C++ builder 5.0 的新手。我使用了在一台机器(Window 2003 Server SP2)上成功编译的小型 STL 应用程序,但在另一台机器(Windows XP 机器 SP3)上没有。我已经放置了一个代码片段和错误消息
Error E2285 Could not find a match for 'distance<>(const AnsiString *,const AnsiString *,i
nt)
我打开了 Borland C++ Form 并在 Form Create 中添加了以下代码
#include <vcl.h>
#pragma hdrstop
#include <vector>
using namespace std;
using std::distance;
static const AnsiString Text_FieldsInTypen[]=
{
"code_segment_national_2"
};
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
vector<AnsiString> aVec;
aVec.push_back("Test");
const AnsiString* Iter;
int Index = 0;
distance(Text_FieldsInTypen, Iter, Index);
}
//---------------------------------------------------------------------------