[fpc-pascal] Access fpc libraries with Java ?

leledumbo leledumbo_cool at yahoo.co.id
Thu Mar 27 17:30:59 CET 2014


fpcside:
// fpclib.pas
library fpclib;

procedure test(env,jcls: pointer; i: longint); cdecl;
begin
  writeln(i);
end;

exports
  test name 'Java_TestFPC_test';

end.

java side:
// TestFPC.java
public class TestFPC {
  public static native void test(int i);

  public static void main(String[] args) {
    System.loadLibrary("fpclib");
    test(255);
  }
}

put both under the same directory, compile each, and execute with: java
-Djava.library.path=. TestFPC



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Access-fpc-libraries-with-Java-tp5718791p5718794.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list