Pascal FPC使用AVL_树
我正在使用Ubuntu11.04和免费的Pascal编译器版本2.4.0-2ubuntu3.1[2011/06/17],用于x86_64版权c 1993-2009,由Florian Klampfl提供 当我试图编译此代码时:Pascal FPC使用AVL_树,pascal,freepascal,Pascal,Freepascal,我正在使用Ubuntu11.04和免费的Pascal编译器版本2.4.0-2ubuntu3.1[2011/06/17],用于x86_64版权c 1993-2009,由Florian Klampfl提供 当我试图编译此代码时: program test; uses AVL_Tree; const N = 10; type Number = ^Integer; var all : TAVLTree; actual :TAVLTreeNode; a,i :Integer; t : array[1.
program test;
uses AVL_Tree;
const N = 10;
type Number = ^Integer;
var all : TAVLTree;
actual :TAVLTreeNode;
a,i :Integer;
t : array[1..N] of Integer;
x :Number;
function compare(a,b:Pointer):LongInt;
begin
compare := Number(a)^ - Number(b)^;
end;
begin
randomize;
for i := 1 to N do
t[i] := i;
all := TAVLTree.Create(@compare);
for i := N downto 1 do
begin
a:=1+random(i);
new(x);
x^:=t[a];
all.add(x);
t[a]:=t[i];
end;
actual := all.findLowest;
while actual <> nil do
begin
Writeln(Number(actual.data)^);
dispose(Number(actual.data));
actual := all.FindSuccessor(actual);
end;
all.Free;
end.
我不知道发生了什么事。。在我的学校里,这个代码运行得很好。。有什么想法吗?问题解决了,我所要做的就是下载FCL。一般来说,我们建议获得整个fpc发行版,即使linux发行版出于内部原因将其拆分。问题解决了,我所要做的就是下载FCL。一般来说,我们建议获得整个fpc发行版,即使linux发行版出于内部原因将其拆分。
Compiling avl.pas
Fatal: Can't find unit AVL_Tree used by test
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)