title: Calling C function from Kotlin using JNI
body: <p>I have created two C functions with the following declarations:</p>
  <pre><code>/* Function Declarations */
  extern void compute_feature_set(double input[1102], double F_data[],
                                  int F_size[2], double D_data[],
                                  int D_size[3], double De_data[],
                                  int De_size[4],
                                  double V[7], double *mp,
                                  double r[12], double *fM);
  </code></pre>
  <p>and...</p>
  <pre><code>/* Function Declarations */
  extern void compute_feature_set_terminate(void);
  </code></pre>
  <p>I have added the code to a Cpp folder and created a CMakeList. The code compiles successfully however I am struggling to call the function using JNI in Kotlin.</p>
  <p>How do I go about changing the functions to make them available for calling in Kotlin?</p>
  <p>Also, I tried using SWIG:</p>
  <p>The following commands return no errors:</p>
  <pre><code>swig -java compute_feature_set.i   
  gcc -c compute_feature_set.c compute_feature_set_wrap.c -I/Users/ferasalsaab/Library/Java/JavaVirtualMachines/openjdk-18.0.1.1/Contents/Home/include -I/Users/ferasalsaab/Library/Java/JavaVirtualMachines/openjdk-18.0.1.1/Contents/Home/include/darwin 
  </code></pre>
  <p>The last one outputs the following error:</p>
  <p>COMMAND:</p>
  <pre><code>g++ -shared compute_feature_set.o compute_feature_set_wrap.o -o libcompute_feature_set.so  
  </code></pre>
  <p>ERROR:</p>
  <blockquote>
  <p>Undefined symbols for architecture arm64:</p>
  </blockquote>