Building pjSip 2.5 - unable to undefined reference to 'pj_jni_jvm'
<p>Trying to build pjSIP from sources for Android, using following guide - <a href="https://trac.pjsip.org/repos/wiki/Getting-Started/Android" rel="nofollow">https://trac.pjsip.org/repos/wiki/Getting-Started/Android</a> </p>

<ol>
<li>Checkout sources of pjsip (2.5)</li>
<li>export ANDROID_NDK_ROOT=/home/dev/android/android-ndk-r9b</li>
<li>export TARGET_ABI=armeabi</li>
<li>export APP_PLATFORM=android-13</li>
<li><p><code>./configure-android --use-ndk-cflags --disable-video --disable-l16-codec --disable-gsm-codec --disable-g722-codec --disable-g7221-codec --disable-ssl --disable-ilbc-codec --disable-tls</code></p></li>
<li><p>configuration is completed successfully.</p></li>
<li><p>make dep &amp;&amp; make clean &amp;&amp; make</p></li>
</ol>

<p>And I got following error - ></p>

<pre><code>../src/pj/guid_android.c:43: error: undefined reference to 'pj_jni_jvm'
../src/pj/guid_android.c:117: error: undefined reference to 'pj_jni_jvm'
</code></pre>

<p>The command invoked by linked which leads to this error </p>

<pre><code>/home/dev/android/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -o ../bin/pjlib-test-arm-unknown-linux-androideabi \
             output/pjlib-test-arm-unknown-linux-androideabi/main.o  output/pjlib-test-arm-unknown-linux-androideabi/activesock.o  output/pjlib-test-arm-unknown-linux-androideabi/atomic.o  output/pjlib-test-arm-unknown-linux-androideabi/echo_clt.o  output/pjlib-test-arm-unknown-linux-androideabi/errno.o  output/pjlib-test-arm-unknown-linux-androideabi/exception.o  output/pjlib-test-arm-unknown-linux-androideabi/fifobuf.o  output/pjlib-test-arm-unknown-linux-androideabi/file.o  output/pjlib-test-arm-unknown-linux-androideabi/hash_test.o  output/pjlib-test-arm-unknown-linux-androideabi/ioq_perf.o  output/pjlib-test-arm-unknown-linux-androideabi/ioq_udp.o  output/pjlib-test-arm-unknown-linux-androideabi/ioq_unreg.o  output/pjlib-test-arm-unknown-linux-androideabi/ioq_tcp.o  output/pjlib-test-arm-unknown-linux-androideabi/list.o  output/pjlib-test-arm-unknown-linux-androideabi/mutex.o  output/pjlib-test-arm-unknown-linux-androideabi/os.o  output/pjlib-test-arm-unknown-linux-androideabi/pool.o  output/pjlib-test-arm-unknown-linux-androideabi/pool_perf.o  output/pjlib-test-arm-unknown-linux-androideabi/rand.o  output/pjlib-test-arm-unknown-linux-androideabi/rbtree.o  output/pjlib-test-arm-unknown-linux-androideabi/select.o  output/pjlib-test-arm-unknown-linux-androideabi/sleep.o  output/pjlib-test-arm-unknown-linux-androideabi/sock.o  output/pjlib-test-arm-unknown-linux-androideabi/sock_perf.o  output/pjlib-test-arm-unknown-linux-androideabi/ssl_sock.o  output/pjlib-test-arm-unknown-linux-androideabi/string.o  output/pjlib-test-arm-unknown-linux-androideabi/test.o  output/pjlib-test-arm-unknown-linux-androideabi/thread.o  output/pjlib-test-arm-unknown-linux-androideabi/timer.o  output/pjlib-test-arm-unknown-linux-androideabi/timestamp.o  output/pjlib-test-arm-unknown-linux-androideabi/udp_echo_srv_sync.o  output/pjlib-test-arm-unknown-linux-androideabi/udp_echo_srv_ioqueue.o  output/pjlib-test-arm-unknown-linux-androideabi/util.o -lpj-arm-unknown-linux-androideabi  -nostdlib -L/home/dev/android/android-ndk-r9b/platforms/android-13/arch-arm/usr/lib -L/home/dev/android/android-ndk-r9b/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/ -lm /home/dev/android/android-ndk-r9b/platforms/android-13/arch-arm/usr/lib/crtbegin_so.o -lgnustl_static  -lc -lgcc -ldl -lOpenSLES -llog   -L/home/dev/android/pjproject-2.5/pjlib/lib -L/home/dev/android/pjproject-2.5/pjlib-util/lib -L/home/dev/android/pjproject-2.5/pjnath/lib -L/home/dev/android/pjproject-2.5/pjmedia/lib -L/home/dev/android/pjproject-2.5/pjsip/lib -L/home/dev/android/pjproject-2.5/third_party/lib           -nostdlib -L/home/dev/android/android-ndk-r9b/platforms/android-13/arch-arm/usr/lib -L/home/dev/android/android-ndk-r9b/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi/
</code></pre>

<p>Code of guid_androind.c </p>

<pre><code>#include &lt;pj/guid.h&gt;
#include &lt;pj/log.h&gt;
#include &lt;pj/string.h&gt;

#include &lt;jni.h&gt;

extern JavaVM *pj_jni_jvm;

static pj_bool_t attach_jvm(JNIEnv **jni_env)
{
    if ((*pj_jni_jvm)-&gt;GetEnv(pj_jni_jvm, (void **)jni_env,
                               JNI_VERSION_1_4) &lt; 0)
    {
        if ((*pj_jni_jvm)-&gt;AttachCurrentThread(pj_jni_jvm, jni_env, NULL) &lt; 0)
        {
            jni_env = NULL;
            return PJ_FALSE;
        }
        return PJ_TRUE;
    }

    return PJ_FALSE;
}

#define detach_jvm(attached) \
    if (attached) \
        (*pj_jni_jvm)-&gt;DetachCurrentThread(pj_jni_jvm);
</code></pre>

<p>Struggling with this error for whole day, any clue is highly appreciated. Meanwhile I'm able to build version 2.3 without any errors, but not 2.5</p>