Insoluble error binding E2065 with XXH32 (xxHash and lz4)

I am currently updating / writing delphi bindings for lz4 and xxHash .

Project status with compiler error is available here .

XxHash.pas line does not work

function XXH32 (const AInput: Pointer; ALength: Integer; ASeed: Cardinal):  Cardinal; cdecl; external name '_XXH32';

When trying to associate the XXH32 function with xxHash.o, this results in error E2065.

[dcc32 Fehler] xxHash.pas(122): E2065 Ungenügende Forward- oder External-Deklaration: 'XXH32'

What I do not understand, all other functions are connected and work without problems.

When I parse xxHash.o while creating a dumpfile, the function is present, like any other of xxHash.o

Objdump Command:

objdump -D xxhash.o > xxhash.o.txt

Dumpfile part xxH32:

xxhash.o:     file format pe-i386
Disassembly of section .text:
00000000 <_XXH32>:
   0:   55                      push   %ebp
   1:   57                      push   %edi
   2:   56                      push   %esi
   3:   53                      push   %ebx
   4:   83 ec 14                sub    $0x14,%esp
   7:   8b 44 24 28             mov    0x28(%esp),%eax
   b:   8b 4c 24 2c             mov    0x2c(%esp),%ecx
...

Any suggestions?

Minimum implementation:

program lz4_minimal;

{$APPTYPE CONSOLE}

{$L xxhash.o}

function XXH32 (const AInput: Pointer; ALength: Integer; ASeed: Cardinal):  Cardinal; cdecl; external name '_XXH32';
function XXH64 (const AInput: Pointer; ALength: Integer; ASeed: UInt64):    UInt64;   cdecl; external name '_XXH64';

//necessary dependencies
function  _malloc(size: cardinal): Pointer; cdecl;
begin
  GetMem(Result, size);
end;

procedure _memcpy(dest, source: Pointer;  count: Integer); cdecl;
begin
  Move(source^, dest^, count);
end;

procedure _free(P: Pointer); cdecl;
begin
 FreeMem(P);
end;

begin
end.

xxHash.o 32bit for windows using MinGW 4.8.1. and the source code for the Yann Collet revision r36 source code included in lz4 . Makefile is included.

github

+4
1

, , xxHash.c .

:

xxhash.o:     file format pe-i386
Disassembly of section .text:
00000000 <_XXDUMMY>:
   0:   b8 2a 00 00 00          mov    $0x2a,%eax
   5:   c3                      ret    
   6:   8d 76 00                lea    0x0(%esi),%esi
   9:   8d bc 27 00 00 00 00    lea    0x0(%edi,%eiz,1),%edi

00000010 <_XXH32>:
  10:   55                      push   %ebp
  11:   57                      push   %edi
  12:   56                      push   %esi
....

, .

E2065.

, MinGW gcc .o Delphi.

+4

All Articles