尝试编译 NDK 的 San Angeles 示例的 JNI(本机)部分(Windows)
我正在尝试按照问题所述进行操作 - 使用 Cygwin shell。我已经根据我在 Google 上搜索到的 2 个基本上等效的教程进行了设置,但是我无法让 shell/make 过程正常工作。显然,Unix/Cygwin 技能缺乏。
因此,我的 Cygwin 已安装到其默认位置,并且我也已正确设置 Android SDK 和 NDK(普通 Java 应用程序可以从 Eclipse 正常构建/调试)。
这就是我修改后的 Cygwin.bat 的样子:
@echo off
set IS_UNIX=
set DEV_ROOT=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles
set JAVA_HOME=c:/PROGRA~1/Java/jdk1.6.0_26
set CLASSPATH=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles/obj
set PATH=c:/PROGRA~1/Android/android-sdk/tools;c:/PROGRA~1/Android/android-ndk-r6
set ANDROID_NDK_ROOT=c:/PROGRA~1/Android/android-ndk-r6
set NDK_PROJECT_PATH=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles
C:
chdir C:\cygwin\bin
bash --login -i
这些路径是正确的。当我更改 NDK 根目录的路径并输入 ./ndk-build 时,结果如下:
nova@edwmini ~
$ cd c:/progra~1/android/android-ndk-r6
nova@edwmini /cygdrive/c/progra~1/android/android-ndk-r6
$ ./ndk-build
/cygdrive/c/progra~1/android/android-ndk-r6/build/core/build-binary.mk:37: *** t
arget pattern contains no `%'. Stop.
nova@edwmini /cygdrive/c/progra~1/android/android-ndk-r6
$
如果我能朝正确的方向踢我的屁股,我将不胜感激。
I'm trying to do what the question says -- using a Cygwin shell. I've set it up according to 2 essentially equivalent tutorials I've Googled but yet I can not get the shell/make process to work properly. Unix/Cygwin skills lack, obviously.
So, my Cygwin is installed to it's default location and I've got the Android SDK and NDK set up right as well (normal Java apps work fine building/debugging from Eclipse).
This is how my modified Cygwin.bat looks:
@echo off
set IS_UNIX=
set DEV_ROOT=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles
set JAVA_HOME=c:/PROGRA~1/Java/jdk1.6.0_26
set CLASSPATH=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles/obj
set PATH=c:/PROGRA~1/Android/android-sdk/tools;c:/PROGRA~1/Android/android-ndk-r6
set ANDROID_NDK_ROOT=c:/PROGRA~1/Android/android-ndk-r6
set NDK_PROJECT_PATH=c:/PROGRA~1/Android/android-ndk-r6/samples/san-angeles
C:
chdir C:\cygwin\bin
bash --login -i
These paths are correct. When I change path to the NDK root and type ./ndk-build, this is the result:
nova@edwmini ~
$ cd c:/progra~1/android/android-ndk-r6
nova@edwmini /cygdrive/c/progra~1/android/android-ndk-r6
$ ./ndk-build
/cygdrive/c/progra~1/android/android-ndk-r6/build/core/build-binary.mk:37: *** t
arget pattern contains no `%'. Stop.
nova@edwmini /cygdrive/c/progra~1/android/android-ndk-r6
$
A kick in my ass in the right direction would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经使用评论解决了问题。
首先,我必须进入项目路径才能构建,其次,当我将所有 DOS 路径替换为 posix/Cygwin 路径时,它很有帮助!这是新的批处理文件:
示例已更改,但您会得到它。另外,@startup,执行: cd $DEV_ROOT
I've fixed the problem using the comments.
Firstly I had to go to the project path in order to build, secondly it helped when I replaced all the DOS paths for posix/Cygwin paths! Here is the new batch file:
The sample has changed but you'll get it. Also, @startup, do: cd $DEV_ROOT