7
System.loadLibrary("example");
8
} catch (UnsatisfiedLinkError e) {
9
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);
14
public static void main(String argv[]) {
15
// Call our gcd() function
19
int g = example.gcd(x,y);
20
System.out.println("The gcd of " + x + " and " + y + " is " + g);
22
// Manipulate the Foo global variable
24
// Output its current value
25
System.out.println("Foo = " + example.get_Foo());
28
example.set_Foo(3.1415926);
30
// See if the change took effect
31
System.out.println("Foo = " + example.get_Foo());