title: Undefined reference for JNI methods
body: <p>I'm trying to use JNI with an existing C library. When I try to generate the .so file using this command:</p>
  
  <pre><code>gcc -shared -fpic -o libWrapper.so -I/usr/lib/jvm/java-1.7.0-openjdk-i386/include/ -I/usr/lib/jvm/java-1.7.0-openjdk-i386/include/linux/ -I/home/testdpdk/packet-pro/dpdk-2.0.0/i686-native-linuxapp-gcc/include Wrapper.c -Wl,-z,defs
  </code></pre>
  
  <p>I get errors to do with undefined references for the methods which are included with the JNI:</p>
  
  <pre><code>/tmp/ccyrfz1B.o: In function `Java_Wrapper_eal_1init':
  Wrapper.c:(.text+0x62): undefined reference to `GetObjectArrayElement'
  Wrapper.c:(.text+0x7f): undefined reference to `GetStringUTFChars'
  Wrapper.c:(.text+0xce): undefined reference to `env_init'
  </code></pre>
  
  <p>How would I go about getting the JNI methods references working? Also, how would I link an existing C library to this shared object file for the 'env_init' method (libWrapper.so)?</p>