Menu

Swig can't find jni.h

Help
Hitarth
2012-05-12
2012-09-22
  • Hitarth

    Hitarth - 2012-05-12

    Hi,

    I am not sure if this is the correct place to ask this question. I have seen
    that there are a few posts about Swig not being able to find jni.h while
    trying to get the PocketSphinxAndroidDemo up and running.

    However, I tried all the solutions mentioned in those topics to no avail.

    I even copied jni.h to the same directory as the file that needed it as an
    include(pocketsphinx_wrap.c) but even then I kept getting the following
    message:

    cc -g -Wall -DPIC -fPIC -I/usr/lib/jvm/default-java/include pkg-config --cflags sphinxbase pocketsphinx -c -o pocketsphinx_wrap.o
    pocketsphinx_wrap.c
    /bin/sh: pkg-config: command not found
    pocketsphinx_wrap.c:135:10: fatal error: 'jni.h' file not found

    include <jni.h></jni.h>

    ^
    1 error generated.
    make: *** Error 1

    I found jni.h on my Mac OSX 10.7 at
    /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h

    I even tried adding the path to the jni.h in to the environment variable
    C_INCLUDE_PATH and CPLUS_INCLUDE_PATH but that didn't have any effect either.

    Please let me know if anyone has any suggestions about what I can do.

     
  • Nickolay V. Shmyrev

    It expects to find jni.h in this folder as specified in Makeflie

    -I/usr/lib/jvm/default-java/include

    If you want to use another location you need to edit Makefile and put the
    right folder there.

    Please read the compiler manual to learn more about compiler flags.

     
  • Hitarth

    Hitarth - 2012-05-18

    Cheers!

     

Log in to post a comment.