Use C with Android ndk

后端 未结 2 841
我在风中等你
我在风中等你 2021-01-18 10:42

I am trying to develop a Android project that makes a simple call from Java code to native C code. I refer this link for my guidance: http://mobile.tutsplus.com/tutorials/an

相关标签:
2条回答
  • 2021-01-18 10:55

    From your question description, i assume that your path is not set. You need to set your NDK path in your environment variable.

    for more information you can visit following site.

    • http://marakana.com/forums/android/examples/49.html
    • http://code.google.com/p/awesomeguy/wiki/JNITutorial#Unpack_Android_NDK
    • How to install and Build NDK with eclipse?
    0 讨论(0)
  • 2021-01-18 10:57

    From my part, I try to set the path by several ways:

    • complete the /etc/paths file with the ndk directory and restart the Mac
    • use the shell command: export NDK_HOME=/Users/myself/directory1/directory2/android-ndk-r9
    • use the Eclipse menu: Eclipse > Preferences > Android > NDK

    However I always get the error message: "ndk-build command not found"

    Finally I solved the issue by setting the path directly in the Build command field of the C/C++ Build Properties dialog box: /Users/myself/directory1/directory2/android-ndk-r9/ndk-build I know it's not a proper solution but it works for me for now.

    0 讨论(0)
提交回复
热议问题