Some C++ functions not working when using jni : UNSATISFIED LINKER IN JAVA

I am writing a function for java in c++.

There are some functions which i intent to use only in the c++ code

here is the code:

#include <jni.h>
#include <iostream>
#include <ncurses.h>
#include "Driver.h"
using namespace std;

JNIEXPORT void JNICALL Java_Driver_func(JNIEnv *env, jobject){
    initscr();          /* Start curses mode          */
    printw("Hello World !!!");  /* Print Hello World          */
    refresh();          /* Print it on to the real screen */
    getch();            /* Wait for user input */

Error :

$java -Djava.library.path=. Main
Exception in thread "main" java.lang.UnsatisfiedLinkError: /path/to/ /path/to/ undefined symbol: stdscr
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(
    at java.base/java.lang.ClassLoader.loadLibrary0(
    at java.base/java.lang.ClassLoader.loadLibrary(
    at java.base/java.lang.Runtime.loadLibrary0(
    at java.base/java.lang.System.loadLibrary(
    at Driver.<clinit>(
    at Main.main(

NOTE: I changed the paths from the error to /path/to/ but thats ok i guess!

Source: Windows Questions C++