radio sam po ovom primjeru:
http://www.ibphoenix.com/resources/documents/search/doc_304
project
Code:
library Project1;
{$mode objfpc}{$H+}
uses
Classes;
{$R *.res}
begin
end.
exports Modulo;
library Project1;
{$mode objfpc}{$H+}
uses
Classes;
{$R *.res}
begin
end.
exports Modulo;
unit1
Code:
unit Unit1;
{$mode objfpc}{$H+}
interface
function Modulo(var i, j: Integer): Integer; cdecl; export;
uses
Classes, SysUtils;
implementation
function Modulo(var i, j: Integer): Integer;
begin
if (j = 0) then
result := -1 // just check the boundary condition, and
// return a reasonably uninteresting answer.
else
result := i mod j;
end;
end.
unit Unit1;
{$mode objfpc}{$H+}
interface
function Modulo(var i, j: Integer): Integer; cdecl; export;
uses
Classes, SysUtils;
implementation
function Modulo(var i, j: Integer): Integer;
begin
if (j = 0) then
result := -1 // just check the boundary condition, and
// return a reasonably uninteresting answer.
else
result := i mod j;
end;
end.
ddl
Code:
DECLARE EXTERNAL FUNCTION F_MODULO
Integer, Integer
RETURNS Integer BY VALUE
ENTRY_POINT 'Modulo'
MODULE_NAME 'libproject1';
DECLARE EXTERNAL FUNCTION F_MODULO
Integer, Integer
RETURNS Integer BY VALUE
ENTRY_POINT 'Modulo'
MODULE_NAME 'libproject1';
kod poziva funkcije mi javi ovu grešku:
Starting transaction...
Preparing query: select f_Modulo(3, 2) from rdb$database
Error: *** IBPP::SQLException ***
Context: Statement::Prepare( select f_Modulo(3, 2) from rdb$database
)
Message: isc_dsql_prepare failed
SQL Message : -104
Invalid token
Engine Code : 335544343
Engine Message :
invalid request BLR at offset 60
function F_MODULO is not defined
module name or entrypoint could not be found
Total execution time: 0,070s