Csound Csound-dev Csound-tekno Search About

[Cs-dev] Shared libsndfile.so for Android

Date2013-06-08 18:15
FromMichael Gogins
Subject[Cs-dev] Shared libsndfile.so for Android
AttachmentsNone  None  
I have enabled the use of libsndfile as a shared library, rather than a static library, for Android simply by changing this:

  static {
    try {
        java.lang.System.loadLibrary("csoundandroid");
    } catch (UnsatisfiedLinkError e) {
        java.lang.System.err.println("csoundandroid native code library failed to load.\n" + e);
        java.lang.System.exit(1);
    }
  }

to this:

  static {
    try {
        java.lang.System.loadLibrary("sndfile");
        java.lang.System.loadLibrary("csoundandroid");
    } catch (UnsatisfiedLinkError e) {
        java.lang.System.err.println("csoundandroid native code library failed to load.\n" + e);
        java.lang.System.exit(1);
    }
  }

in android_interface. I learned this by googling, it seems the Android linker is not good at figuring out library load order on its own.

Back to the plugin opcodes...

Some other advice I googled:

-- Don't use C++ exceptions or runtime type information.

-- Don't use C++ libraries that statically link with other C++ libraries, there can be static initialization problems.

I've tried to fix the makefiles to address these issues.

Regards,
Mike

Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com