On Thu, 09 Mar 2006 18:02:52 +0100
[EMAIL PROTECTED] wrote:
>
> Hi!
>
> Could you help with this program?
> I am testing the functionality of Dynhasharray but
>
> I get these errors:
> dynhasharray.lpr(18,9) Warning: Variable "A" does not seem to be
> initialized C:\lazarus\dynhasharray\dynhasharray.o(.text+0x2f): In
> function `main': dynhasharray.lpr:18: undefined reference to
> `DYNHASHARRAY_TDYNHASHARRAY_$__ADD$POINTER'
> C:\lazarus\dynhasharray\dynhasharray.o(.data+0x4c):dynhasharray.lpr:21:
> undefined reference to `DEBUGINFO_DYNHASHARRAY'
> C:\lazarus\dynhasharray\dynhasharray.o(.data+0xdc):dynhasharray.lpr:21:
> undefined reference to `THREADVARLIST_DYNHASHARRAY'
> C:\lazarus\dynhasharray\dynhasharray.o(.data+0x15c):dynhasharray.lpr:21:
> undefined reference to `FINALIZE$_DYNHASHARRAY'
> dynhasharray.lpr(21,1) Error: Error while linking
This is typically the result of a dirty build. Please make sure, your unnit
path does not include any of the lazarus .pas/.pp directories, but only .ppu
directories. And rebuild lazarus clean.
> thanks
>
> Equinox
>
> program dynhasharraytest;
>
> {$mode objfpc}{$H+}
>
> uses
> {$IFDEF UNIX}{$IFDEF UseCThreads}
> cthreads,
> {$ENDIF}{$ENDIF}
> Classes,DynHashArray,strings;
>
> var
> A:TDynHashArray;
> s:pchar;
> begin
> //A:=A.Create;
> new(s);
Don't use 'new' on PChar.
> s:=StrNew ('u');
> A.Add(s);
> //A.OwnerHashFunction:=TDynHashArray.SlowAlternativeHashMethod;
A:=TDynHashArray.Create;
s:=StrNew('Some Text');
A.Add(s);
> end.
If you only need a String to pointer hash array:
There is already one in lcl/stringhashlist.pas
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives