Subject | my UDF shared libray can not be used in Vulcan |
---|---|
Author | heroes3lover |
Post date | 2007-08-28T01:55:29Z |
Hi,
This issue totally confused me.
I installed Vulcan in Fedora Core 7, and the service and connection
work perfectly.
But I need to migrate our UDF file to Vulcan, so I install free
pascal compiler, and changes uses clause in my source, and compile
successfully. but I can not use the functions in SQL.
So I copy the testing code in doc
library subs;
function SubStr( CString : PChar ; FromPos , ToPos : Longint ) :
PChar ; cdecl ;
var
Length : Integer ;
begin
Length : = StrLen ( CString ) ;
SubStr : = CString + Length ;
i f ( FromPos > 0 ) and ( ToPos >= FromPos ) then
begin
if Length >= FromPos then
SubStr : = CString + FromPos - 1;
if Length > ToPos then
CString [ ToPos ] : = # 0 ;
end ;
end ;
exports
SubStr ;
end.
and compile this code, I got libsubs.so file and put in the Vulcan
bin directory, and the /etc/lib directory.
I export the function and use function in SQL, it does not work, say
function SUBSTR is not defined
module name or entrypoint could not be found
So I copy a test program,
program testsubs ;
function SubStr ( const CSt r ing : PChar ; FromPos , ToPos : l o n g
i n t ) : PChar ;
cdecl ; external 'subs' ;
vars
: PChar ;
FromPos , ToPos : Integer ;
begin
s : = ' Test ' ;
FromPos : = 2 ;
ToPos : = 3 ;
WriteLn ( SubStr ( s , FromPos , ToPos ) ) ;
end .
It works very well and the result is 'es'.
I dont know why I can not use in Vulcan,
then I copy the ib_udf.so from firebird 2.0 linux to the bin
directory, it works as well.
which totally confuse me, does anybody has idea about that?
Thanks,
Roc
This issue totally confused me.
I installed Vulcan in Fedora Core 7, and the service and connection
work perfectly.
But I need to migrate our UDF file to Vulcan, so I install free
pascal compiler, and changes uses clause in my source, and compile
successfully. but I can not use the functions in SQL.
So I copy the testing code in doc
library subs;
function SubStr( CString : PChar ; FromPos , ToPos : Longint ) :
PChar ; cdecl ;
var
Length : Integer ;
begin
Length : = StrLen ( CString ) ;
SubStr : = CString + Length ;
i f ( FromPos > 0 ) and ( ToPos >= FromPos ) then
begin
if Length >= FromPos then
SubStr : = CString + FromPos - 1;
if Length > ToPos then
CString [ ToPos ] : = # 0 ;
end ;
end ;
exports
SubStr ;
end.
and compile this code, I got libsubs.so file and put in the Vulcan
bin directory, and the /etc/lib directory.
I export the function and use function in SQL, it does not work, say
function SUBSTR is not defined
module name or entrypoint could not be found
So I copy a test program,
program testsubs ;
function SubStr ( const CSt r ing : PChar ; FromPos , ToPos : l o n g
i n t ) : PChar ;
cdecl ; external 'subs' ;
vars
: PChar ;
FromPos , ToPos : Integer ;
begin
s : = ' Test ' ;
FromPos : = 2 ;
ToPos : = 3 ;
WriteLn ( SubStr ( s , FromPos , ToPos ) ) ;
end .
It works very well and the result is 'es'.
I dont know why I can not use in Vulcan,
then I copy the ib_udf.so from firebird 2.0 linux to the bin
directory, it works as well.
which totally confuse me, does anybody has idea about that?
Thanks,
Roc