On the Mac, used the following command to compile the sample_DhtRead.c
file:

gcc -fPIC -c sample_DhtRead.c -I
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/include/
-I
/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/include/darwin/

Created shared library:

gcc sample_DhtRead.o -shared -o libdhtread.so -Wl,-install_name,dhtread
(on Mac the command gcc sample_DhtRead.o -shared -o libdhtread.so
-Wl,-soname,dhtread did not work: replaced 'soname' with 'install_name')
adding sample project 'dhtread-sample'