title: In C++ program how to call a constructor of C++ class which in dynamic library(.so)
body: <p>I can call a common function of C++ class which in dynamic library(.so),but I do not know how to call a constructor of C++ class which in dynamic library(.so).</p>
  
  <pre><code>JNIEXPORT jint JNICALL Java_com_example_hellobreakdd_MainActivity_helloBreak (JNIEnv *, jobject){
  
  void *handle;
  
  double (*cosine)(double);
  
  char *error;
  
  handle = dlopen("libtest.so", RTLD_NOW);
  
  if (!handle) {
      __android_log_print(ANDROID_LOG_ERROR, "start", dlerror());
  }
  
  *(void **) (&amp;cosine) = dlsym(handle, "Add");
  
  printf("%f\n", (*cosine)(2.0));
  
  dlclose(handle);
  
  return 1;
  </code></pre>
  
  <p>}</p>