Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using gcc (in Cygwin) for JNI - resource.h not found. drand48 not found

843829Jul 29 2010 — edited Jul 29 2010
Hello,

I am trying to use gcc for JNI. I have successfully executed simple programs like Hello World and Message Box. Now I have a C project that I am trying to use in JNI (Its FOIL 6.4 by Quinlan).

I have written the .java file and the .c (wrapper) file and am calling the top level function from FOIL. Whenever I try to run it I get several errors.

sys/resource.h: No such file or directory.
/tmp/ccGi67I4.o:state.c:(.text+0x4cb): undefined reference to `_drand48'
/tmp/ccGi67I4.o:state.c:(.text+0x85a): undefined reference to `_drand48'

I have the resource.h file in C:\cygwin\usr\include\sys but it still doesnt find it.
And drand48 is present in one of the include files, but it still gives me this error.

the way I use gcc to create the dll is:

$CYGWINBIN/gcc-3.exe -mno-cygwin -I$jdk/include -I$jdk/include/win32 -Wl,--add-stdcall-alias -shared -o foilJNI.dll foilJNI.c global.c main.c input.c output.c state.c literal.c evaluatelit.c search.c determinate.c order.c join.c utility.c finddef.c interpret.c prune.c constants.c

where $CYGWINBIN is C:\cygwin\bin
and $jdk is C:\Java\jdk1.6.0_20

Can anyone please tell me where the problem is.
Any suggestions are welcome.

Thanks
Nick
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2010
Added on Jul 29 2010
1 comment
364 views