Subject | Write UDF for 3.0 - Linux 64bit vs Windows 32bit |
---|---|
Author | Gabor Boros |
Post date | 2018-04-19T11:16:46Z |
Hi All,
I use 3.0.3 SS on Linux 64bit and need to know the server's UTC
timestamp. First started with a simple example UDF which written with
FreePascal 3.0.4. See below. After many trying without success I
realized my example works like a charm with Win32. (Just compiled with
"fpc MY_UDF.pas" command.) But I use Linux 64bit. What I am doing wrong?
library MY_UDF;
{$MODE DELPHI}
{$IFDEF UNIX}uses cthreads;{$ENDIF}
function TEST_UDF:Int64;
begin
Result:=123
end;
exports
TEST_UDF;
begin
IsMultiThread:=True;
end.
DECLARE EXTERNAL FUNCTION TEST_UDF BIGINT RETURNS PARAMETER 1
ENTRY_POINT 'TEST_UDF' MODULE_NAME 'MY_UDF';
SELECT TEST_UDF() FROM RDB$DATABASE
With Win32 I see the correct 123 result but with Linux 64bit the next
error appears:
Invalid token.
invalid request BLR at offset 36.
function TEST_UDF is not defined.
module name or entrypoint could not be found.
Gabor
I use 3.0.3 SS on Linux 64bit and need to know the server's UTC
timestamp. First started with a simple example UDF which written with
FreePascal 3.0.4. See below. After many trying without success I
realized my example works like a charm with Win32. (Just compiled with
"fpc MY_UDF.pas" command.) But I use Linux 64bit. What I am doing wrong?
library MY_UDF;
{$MODE DELPHI}
{$IFDEF UNIX}uses cthreads;{$ENDIF}
function TEST_UDF:Int64;
begin
Result:=123
end;
exports
TEST_UDF;
begin
IsMultiThread:=True;
end.
DECLARE EXTERNAL FUNCTION TEST_UDF BIGINT RETURNS PARAMETER 1
ENTRY_POINT 'TEST_UDF' MODULE_NAME 'MY_UDF';
SELECT TEST_UDF() FROM RDB$DATABASE
With Win32 I see the correct 123 result but with Linux 64bit the next
error appears:
Invalid token.
invalid request BLR at offset 36.
function TEST_UDF is not defined.
module name or entrypoint could not be found.
Gabor