Autor Beitrag
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 11.12.10 03:00 
Hey,

ich hab ein seltsames Problem. Und zwar versuche ich eine Klasse schon vor-zu-deklarieren, das ich sie dann in einer anderen benutzen kann. Aber mein Delphi 7 SE sagt mir immer: Type 'TTest' is not yet completely defined.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
TTest = class;

TUseTest = class(TObject)
  fTest: TTest;
end;

Test = class(TObject)
  fData: Integer;
end;

Ich hab auch schon gegoogelt un da wird es genau so gemacht. Warum funktioniert das bei mir so nicht?

MfG & Thx Bergmann.


Moderiert von user profile iconNarses: Topic aus VCL (Visual Component Library) verschoben am Sa 11.12.2010 um 23:58

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 11.12.10 03:44 
Du deklarierst TTest nirgends... Nur Test...
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 11.12.10 03:52 
Hey,

das war n Tippfehler, sry. Die Klassen die ich benutzt hab waren etwas komplexer. Hab den Fehler auch gefunden. Zwischen der Forward Declaration un der eigentlichen Declaration stand noch ein type, das hat ihn anscheint verwirrt. Jetzt gehts ;)

MfG Bergmann.

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 11.12.10 09:07 
Forward Deklarationen gehen nur im selben Type-Block, das verwirrt den Compiler nicht, sondern ist so festgelegt.
Bergmann89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 11.12.10 16:57 
Das wusste ich eben nich^^

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^