java - Can I call a C function from a C program called by JNI? -


i have done research jni,and think understand how works, i've been trying call c function c func called jni.

i have 2 .c, helloworld , helloworld2, , java program call helloworld. helloworld @ same time calls function defined in hellowold2 causes error when executing.

java: symbol lookup error: /home/hduser/desktop/final2/libhello.so: undefined symbol: helloworld

assuming have 2 files:

helloworld.c helloworld2.c

and helloworld supposed call helloworld2 can:

  • put both same shared lib
  • put both separate shared lib , make sure helloworld linked helloworld2

make sure shared libraries visible setting ld_library_path.

you can find jni samples here: http://jnicookbook.owsiak.org/


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -