6 System.loadLibrary("example");
7 } catch (UnsatisfiedLinkError e) {
8 System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
13 public static void main(String argv[]) {
19 // Now call our C function with a bunch of callbacks
21 System.out.println( "Trying some C callback functions" );
22 System.out.println( " a = " + a );
23 System.out.println( " b = " + b );
24 System.out.println( " ADD(a,b) = " + example.do_op(a,b,example.ADD) );
25 System.out.println( " SUB(a,b) = " + example.do_op(a,b,example.SUB) );
26 System.out.println( " MUL(a,b) = " + example.do_op(a,b,example.MUL) );
28 System.out.println( "Here is what the C callback function classes are called in Java" );
29 System.out.println( " ADD = " + example.ADD.getClass().getName() );
30 System.out.println( " SUB = " + example.SUB.getClass().getName() );
31 System.out.println( " MUL = " + example.MUL.getClass().getName() );