tags:

views:

37

answers:

1

Hello I am trying to use swig tool for my ".c" files.

i run the following commands ,

$swig -java example.i

$gcc -c example.c example_wrap.c -I/c/jdk1.3.1/include -I/c/jdk1.3.1/include/win32

Then i got the following error.

example_wrap.c:135:17: error: jni.h: No such file or directory

example_wrap.c:159: error: expected ‘)’ before ‘*’ token

example_wrap.c:201: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘Java_exampleJNI_My_1variable_1set’

example_wrap.c:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘JNICALL’

example_wrap.c:223: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘JNICALL’

example_wrap.c:237: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘JNICALL’

example_wrap.c:253: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘JNICALL’

where will be jni.h will be located. and how do i specify the path to include that. can any one please provide me the solution.

A: 

Are you really using JDK 1.3? that is a pretty old version.

On my system its located: /usr/lib/jvm/java-6-sun-1.6.0.20/include/jni.h So I would think what you've already done with should be enough... Maybe there is some issue with either this older JDK, or your install?

Petriborg