title: TObjectList E2003 Undeclared identifier TObjectList<>
body: <p>I've been introduced to TObjectList, and I would like to make use of it, except that I can't seem to get even the <a href="http://docwiki.embarcadero.com/CodeExamples/XE2/en/Generics_Collections_TObjectList_%28Delphi%29" rel="nofollow noreferrer">sample code from Embarcadero's web site</a> to work for me.  Here is my code:</p>
  
  <pre><code>unit Test03Unit1;
  
  interface
  
  uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
  
  type
    TForm1 = class(TForm)
      Button1: TButton;
      procedure Button1Click(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
  
  type
    { Declare a new object type. }
    TNewObject = class
    private
      FName: String;
  
    public
      constructor Create(const AName: String);
      destructor Destroy(); override;
    end;
  
  { TNewObject }
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  constructor TNewObject.Create(const AName: String);
  begin
    FName := AName;
  end;
  
  destructor TNewObject.Destroy;
  begin
    { Show a message whenever an object is destroyed. }
    MessageDlg('Object "' + FName + '" was destroyed!', mtInformation, [mbOK], 0);
    inherited;
  end;
  
  procedure TForm1.Button1Click(Sender: TObject);
  var
    List: TObjectList&lt;TNewObject&gt;;
    Obj: TNewObject;
  begin
    { Create a new List. }
    { The OwnsObjects property is set by default to true -- the list will free the owned objects automatically. }
    List := TObjectList&lt;TNewObject&gt;.Create();
  
    { Add some items to the List. }
    List.Add(TNewObject.Create('One'));
    List.Add(TNewObject.Create('Two'));
  
    { Add a new item, but keep the reference. }
    Obj := TNewObject.Create('Three');
    List.Add(Obj);
  
    {
      Remove an instance of the TNewObject class. Destructor
      is called for the owned objects, because you have set the OwnsObjects
      to true.
    }
    List.Delete(0);
    List.Extract(Obj);
  
    { Destroy the List completely--more message boxes will be shown. }
    List.Free;
  
  end;
  
  end.
  </code></pre>
  
  <p>When trying to compile this, I get the error [DCC Error] Test03Unit1.pas(51): E2003 Undeclared identifier: 'TObjectList&lt;>'.  Line 51 is the line which says:</p>
  
  <pre><code>List: TObjectList&lt;TNewObject&gt;;
  </code></pre>
  
  <p>I have never seen &lt; > used in the Pascal language before, so this is completely new territory for me.  Doing a google search for "Delphi and &lt; >" doesn't seem to tell me what I need to know about this.  From <a href="https://stackoverflow.com/questions/1660698/delphi-how-to-use-tobjectlistt">other examples I can find on the internet</a> it seems to be the correct way to use it.</p>
  
  <p>Using Delphi XE2.</p>
  
  <p>What am I doing wrong?</p>