Discussion:
Build sample/hello-jni in Windows/Cygwin
(too old to reply)
technicware
2012-04-28 20:01:27 UTC
Permalink
Hi,

Has anyone successfully compiled the sample/hello-jni under Windows/Cygwin?

1) After a few attempts, I realize that you cannot run ndk-build inside a
Cygwin shell. You must run ndk-build.cmd inside a MSDOS command window. The
documentation should have mention this obvious pitfall.

2) First attempt to build hello-jni looks like this:

C:\java\android-ndk-r7b\samples\hello-jni>path=c:\cygwin\bin;%path%
C:\java\android-ndk-r7b\samples\hello-jni>\java\android-ndk-r7b\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [libs/armeabi/gdbserver] Error 1

3) Second and later attempt looks like this:

C:\java\android-ndk-r7b\samples\hello-jni>c:\java\android-ndk-r7b\ndk-build
make: *** [clean-installed-binaries] Error 127

4) Building hello-jni on Linux looks like this:

/opt/android-ndk-r7c/samples/hello-jni>$NDK/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi/libhello-jni.so

It seems so wrong that a simple sample cannot be built under
Windows/Cygwin. Has anyone one in Google tested this?

Thanks

--technicware
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/kmnrVe1xpyYJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
David Turner
2012-05-03 15:21:18 UTC
Permalink
Post by technicware
Hi,
Has anyone successfully compiled the sample/hello-jni under Windows/Cygwin?
1) After a few attempts, I realize that you cannot run ndk-build inside a
Cygwin shell. You must run ndk-build.cmd inside a MSDOS command window. The
documentation should have mention this obvious pitfall.
No, ndk-build should still work with cygwin, what kind of errors did you
get? Maybe this is related to your installation.
Post by technicware
C:\java\android-ndk-r7b\samples\hello-jni>path=c:\cygwin\bin;%path%
C:\java\android-ndk-r7b\samples\hello-jni>\java\android-ndk-r7b\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [libs/armeabi/gdbserver] Error 1
You're trying to use cygwin programs with ndk-build.cmd, this cannot work.
Do not put C:\cygwin\bin in your path, then try to launch ndk-build again.
Post by technicware
C:\java\android-ndk-r7b\samples\hello-jni>c:\java\android-ndk-r7b\ndk-build
make: *** [clean-installed-binaries] Error 127
/opt/android-ndk-r7c/samples/hello-jni>$NDK/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi/libhello-jni.so
It seems so wrong that a simple sample cannot be built under
Windows/Cygwin. Has anyone one in Google tested this?
Thanks
--technicware
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-ndk/-/kmnrVe1xpyYJ.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
technicware
2012-05-04 15:25:04 UTC
Permalink
Digit,

Thanks for the tip, but don't you see the contradiction? Using NDK on
Windows requires Cygwin, but you must NOT put cygwin/bin in your Windows
PATH. I guess NDK look for Cygwin from the Windows registry.

I would make the BASH script ndk-build compatible with Cygwin and remove or
marginalize ndk-build.cmd.

--Michael
Post by David Turner
Post by technicware
Hi,
Has anyone successfully compiled the sample/hello-jni under
Windows/Cygwin?
1) After a few attempts, I realize that you cannot run ndk-build inside a
Cygwin shell. You must run ndk-build.cmd inside a MSDOS command window. The
documentation should have mention this obvious pitfall.
No, ndk-build should still work with cygwin, what kind of errors did you
get? Maybe this is related to your installation.
Post by technicware
C:\java\android-ndk-r7b\samples\hello-jni>path=c:\cygwin\bin;%path%
C:\java\android-ndk-r7b\samples\hello-jni>\java\android-ndk-r7b\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [libs/armeabi/gdbserver] Error 1
You're trying to use cygwin programs with ndk-build.cmd, this cannot work.
Do not put C:\cygwin\bin in your path, then try to launch ndk-build again.
Post by technicware
C:\java\android-ndk-r7b\samples\hello-jni>c:\java\android-ndk-r7b\ndk-build
make: *** [clean-installed-binaries] Error 127
/opt/android-ndk-r7c/samples/hello-jni>$NDK/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi/libhello-jni.so
It seems so wrong that a simple sample cannot be built under
Windows/Cygwin. Has anyone one in Google tested this?
Thanks
--technicware
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-ndk/-/kmnrVe1xpyYJ.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/n5MBIE7bCOoJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
David Turner
2012-05-04 15:46:42 UTC
Permalink
Post by technicware
Digit,
Thanks for the tip, but don't you see the contradiction? Using NDK on
Windows requires Cygwin, but you must NOT put cygwin/bin in your Windows
PATH. I guess NDK look for Cygwin from the Windows registry.
- the NDK doesn't require Cygwin on Windows, you can build with
ndk-build.cmd from the Windows command prompt.
- however, when doing this, you should *not* have the Cygwin bin
directory in your path
Post by technicware
I would make the BASH script ndk-build compatible with Cygwin and remove
or marginalize ndk-build.cmd.
ndk-build should *already* compatible with Cygwin, or else it's a bug.
Please provide more information about why you can't use it in your setup,
for example what is the output of "ndk-build NDK_LOG=1" ?
Post by technicware
--Michael
Post by David Turner
Post by technicware
Hi,
Has anyone successfully compiled the sample/hello-jni under
Windows/Cygwin?
1) After a few attempts, I realize that you cannot run ndk-build inside
a Cygwin shell. You must run ndk-build.cmd inside a MSDOS command window.
The documentation should have mention this obvious pitfall.
No, ndk-build should still work with cygwin, what kind of errors did you
get? Maybe this is related to your installation.
Post by technicware
C:\java\android-ndk-r7b\**samples\hello-jni>path=c:\**cygwin\bin;%path%
C:\java\android-ndk-r7b\**samples\hello-jni>\java\**
android-ndk-r7b\ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [libs/armeabi/gdbserver] Error 1
You're trying to use cygwin programs with ndk-build.cmd, this cannot
work. Do not put C:\cygwin\bin in your path, then try to launch ndk-build
again.
Post by technicware
C:\java\android-ndk-r7b\**samples\hello-jni>c:\java\**
android-ndk-r7b\ndk-build
make: *** [clean-installed-binaries] Error 127
/opt/android-ndk-r7c/samples/**hello-jni>$NDK/ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi/libhello-jni.so
It seems so wrong that a simple sample cannot be built under
Windows/Cygwin. Has anyone one in Google tested this?
Thanks
--technicware
--
You received this message because you are subscribed to the Google
Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/**
msg/android-ndk/-/kmnrVe1xpyYJ<https://groups.google.com/d/msg/android-ndk/-/kmnrVe1xpyYJ>
**.
For more options, visit this group at http://groups.google.com/**
group/android-ndk?hl=en<http://groups.google.com/group/android-ndk?hl=en>
.
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-ndk/-/n5MBIE7bCOoJ.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
technicware
2012-05-04 22:04:53 UTC
Permalink
Digit,
Post by technicware
Thanks for the tip, but don't you see the contradiction? Using NDK on
Post by technicware
Windows requires Cygwin, but you must NOT put cygwin/bin in your Windows
PATH. I guess NDK look for Cygwin from the Windows registry.
- the NDK doesn't require Cygwin on Windows, you can build with
ndk-build.cmd from the Windows command prompt.
- however, when doing this, you should *not* have the Cygwin bin
directory in your path
It's nice to know NDK doesn't need Cygwin, but that contradicts what one
read from this NDK overview:

http://developer.android.com/sdk/ndk/overview.html

Windows is always mentioned with Cygwin. Perhaps the doc needs to be
updated (starting from which version NDK no longer require Cygwin).
Post by technicware
I would make the BASH script ndk-build compatible with Cygwin and remove
Post by technicware
or marginalize ndk-build.cmd.
ndk-build should *already* compatible with Cygwin, or else it's a bug.
Please provide more information about why you can't use it in your setup,
for example what is the output of "ndk-build NDK_LOG=1" ?
Here is the output of building hello-jni in Cygwin bash prompt using the
Windows version of r7b download:

/cygdrive/c/java/android-ndk-r7b>NDK=$PWD
/cygdrive/c/java/android-ndk-r7b>cd samples/hello-jni/
/cygdrive/c/java/android-ndk-r7b/samples/hello-jni>$NDK/ndk-build NDK_LOG=1
Android NDK: NDK installation path auto-detected:
'/cygdrive/c/java/android-ndk-r7b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Found /bin/uname.exe on Windows host
Android NDK: uname -s returned: CYGWIN_NT-5.1
Android NDK: Cygwin detected: CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3)
2012-02-24 14:05 i686 Cygwin
Android NDK: Host operating system detected: cygwin
Android NDK: Host CPU was auto-detected:
Android NDK: HOST_TAG set to windows-
Android NDK: Host tols prebuilt directory not found
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'awk' tool: awk
Android NDK: Host 'awk' test returned: Pass
Android NDK: Probing for 'cygpath' program
Android NDK: 'cygpath' found as: /usr/bin/cygpath
Using cygwin substitution rules:
/cygdrive/d => D:
/cygdrive/D => D:
/usr/lib => C:/cygwin/lib
/usr/bin => C:/cygwin/bin
/c => C:
/C => C:
/ => C:/cygwin
Android NDK: This NDK supports the following target architectures and ABIS:
Android NDK: arm: armeabi armeabi-v7a
Android NDK: x86: x86
Android NDK: This NDK supports the following toolchains and target ABIs:
Android NDK: arm-linux-androideabi-4.4.3: armeabi armeabi-v7a
Android NDK: x86-4.4.3: x86
Android NDK: Found platform root directory:
/cygdrive/c/java/android-ndk-r7b/platforms
Android NDK: Found supported platforms: android-14 android-3 android-4
android-5 android-8 android-9
Android NDK: PLATFORM android-14 supports: arm x86
Android NDK: ABI arm sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-14/arch-arm
Android NDK: ABI x86 sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-14/arch-x86
Android NDK: PLATFORM android-3 supports: arm x86
Android NDK: ABI arm sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-3/arch-arm
Android NDK: ABI x86 sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-3/arch-x86
Android NDK: PLATFORM android-4 supports: arm x86
Android NDK: ABI arm sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-4/arch-arm
Android NDK: ABI x86 sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-4/arch-x86
Android NDK: PLATFORM android-5 supports: arm x86
Android NDK: ABI arm sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-5/arch-arm
Android NDK: ABI x86 sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-5/arch-x86
Android NDK: PLATFORM android-8 supports: arm x86
Android NDK: ABI arm sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-8/arch-arm
Android NDK: ABI x86 sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-8/arch-x86
Android NDK: PLATFORM android-9 supports: arm x86
Android NDK: ABI arm sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-9/arch-arm
Android NDK: ABI x86 sysroot is:
/cygdrive/c/java/android-ndk-r7b/platforms/android-9/arch-x86
Android NDK: Found stable platform levels: 14 3 4 5 8 9
Android NDK: Found max platform level: 14
Android NDK: Found project path: .
Android NDK: Parsing
/cygdrive/c/java/android-ndk-r7b/build/core/default-application.mk
Android NDK: Found APP_PLATFORM=android-8 in ./default.properties
Android NDK: Using build script ./jni/Android.mk
Android NDK: Application 'local' *is* debuggable
Android NDK: Selecting debug optimization mode (app is debuggable)
Android NDK: Adding import directory:
/cygdrive/c/java/android-ndk-r7b/sources
Android NDK: Building application 'local' for ABI 'armeabi'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for
'armeabi' ABI
Android NDK: Looking for imported module with tag 'cxx-stl/system'
Android NDK: Probing
/cygdrive/c/java/android-ndk-r7b/sources/cxx-stl/system/Android.mk
Android NDK: Found in
/cygdrive/c/java/android-ndk-r7b/sources/cxx-stl/system
make:
/cygdrive/c/java/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-/bin/arm-linux-androideabi-gcc:
Command not found
make:
/cygdrive/c/java/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-/bin/arm-linux-androideabi-gcc:
Command not found
Android NDK: Cygwin dependency file conversion script:
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then sed
-e 's!^C:/cygwin/lib!/usr/lib!ig;s! C:/cygwin/lib!
/usr/lib!ig;s!^C:/cygwin/bin!/usr/bin!ig;s! C:/cygwin/bin!
/usr/bin!ig;s!^C:/cygwin/!/!ig;s! C:/cygwin/! /!ig;s!^D:!/cygdrive/d!ig;s!
D:! /cygdrive/d!ig;s!^C:!/c!ig;s! C:! /c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
/bin/sh:
/cygdrive/c/java/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-/bin/arm-linux-androideabi-gcc:
No such file or directory
make: *** [obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 127
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/Vgmb8zWhFhwJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Angel Segura
2012-05-04 22:53:36 UTC
Permalink
The NDK on windows works fine as of NDK-r6 version (I just move from it a
week ago).
The problem you are experiencing must be a configuration related feature: a
missing file, a corrupted file, a bad project configuration file. For a
fresh/clean kick start, I would recommend you the NVIDIA Tegra Android
Development SDK. It ussually comes with the latest working NDK version,
plus, the android SDK, plus, an installation with eclipse ready with the
CDT and ADT plugin to develop native activities. The eclipse IDE version of
the installation comes with a builtin plugin that has configured the post
steps to compile your code, so no need for a terminal window and having to
manage all those nasty configuration files.

I hope you can solve your problem.

Cheers.
Post by technicware
Digit,
Post by technicware
Thanks for the tip, but don't you see the contradiction? Using NDK on
Post by technicware
Windows requires Cygwin, but you must NOT put cygwin/bin in your Windows
PATH. I guess NDK look for Cygwin from the Windows registry.
- the NDK doesn't require Cygwin on Windows, you can build with
ndk-build.cmd from the Windows command prompt.
- however, when doing this, you should *not* have the Cygwin bin
directory in your path
It's nice to know NDK doesn't need Cygwin, but that contradicts what one
http://developer.android.com/sdk/ndk/overview.html
Windows is always mentioned with Cygwin. Perhaps the doc needs to be
updated (starting from which version NDK no longer require Cygwin).
Post by technicware
I would make the BASH script ndk-build compatible with Cygwin and remove
Post by technicware
or marginalize ndk-build.cmd.
ndk-build should *already* compatible with Cygwin, or else it's a bug.
Please provide more information about why you can't use it in your setup,
for example what is the output of "ndk-build NDK_LOG=1" ?
Here is the output of building hello-jni in Cygwin bash prompt using the
/cygdrive/c/java/android-ndk-r7b>NDK=$PWD
/cygdrive/c/java/android-ndk-r7b>cd samples/hello-jni/
/cygdrive/c/java/android-ndk-r7b/samples/hello-jni>$NDK/ndk-build NDK_LOG=1
'/cygdrive/c/java/android-ndk-r7b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Found /bin/uname.exe on Windows host
Android NDK: uname -s returned: CYGWIN_NT-5.1
Android NDK: Cygwin detected: CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3)
2012-02-24 14:05 i686 Cygwin
Android NDK: Host operating system detected: cygwin
Android NDK: HOST_TAG set to windows-
Android NDK: Host tols prebuilt directory not found
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'awk' tool: awk
Android NDK: Host 'awk' test returned: Pass
Android NDK: Probing for 'cygpath' program
Android NDK: 'cygpath' found as: /usr/bin/cygpath
/usr/lib => C:/cygwin/lib
/usr/bin => C:/cygwin/bin
/ => C:/cygwin
Android NDK: arm: armeabi armeabi-v7a
Android NDK: x86: x86
Android NDK: arm-linux-androideabi-4.4.3: armeabi armeabi-v7a
Android NDK: x86-4.4.3: x86
/cygdrive/c/java/android-ndk-r7b/platforms
Android NDK: Found supported platforms: android-14 android-3 android-4
android-5 android-8 android-9
Android NDK: PLATFORM android-14 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-14/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-14/arch-x86
Android NDK: PLATFORM android-3 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-3/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-3/arch-x86
Android NDK: PLATFORM android-4 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-4/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-4/arch-x86
Android NDK: PLATFORM android-5 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-5/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-5/arch-x86
Android NDK: PLATFORM android-8 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-8/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-8/arch-x86
Android NDK: PLATFORM android-9 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-9/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-9/arch-x86
Android NDK: Found stable platform levels: 14 3 4 5 8 9
Android NDK: Found max platform level: 14
Android NDK: Found project path: .
Android NDK: Parsing /cygdrive/c/java/android-ndk-r7b/build/core/
default-application.mk
Android NDK: Found APP_PLATFORM=android-8 in ./default.properties
Android NDK: Using build script ./jni/Android.mk
Android NDK: Application 'local' *is* debuggable
Android NDK: Selecting debug optimization mode (app is debuggable)
/cygdrive/c/java/android-ndk-r7b/sources
Android NDK: Building application 'local' for ABI 'armeabi'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for
'armeabi' ABI
Android NDK: Looking for imported module with tag 'cxx-stl/system'
Android NDK: Probing
/cygdrive/c/java/android-ndk-r7b/sources/cxx-stl/system/Android.mk
Android NDK: Found in
/cygdrive/c/java/android-ndk-r7b/sources/cxx-stl/system
Command not found
Command not found
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then
sed -e 's!^C:/cygwin/lib!/usr/lib!ig;s! C:/cygwin/lib!
/usr/lib!ig;s!^C:/cygwin/bin!/usr/bin!ig;s! C:/cygwin/bin!
/usr/bin!ig;s!^C:/cygwin/!/!ig;s! C:/cygwin/! /!ig;s!^D:!/cygdrive/d!ig;s!
D:! /cygdrive/d!ig;s!^C:!/c!ig;s! C:! /c!ig;' $1.org > $1 && rm -f $1.orgfi
------ end of script -----
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
No such file or directory
make: *** [obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 127
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-ndk/-/Vgmb8zWhFhwJ.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
technicware
2012-05-04 23:03:37 UTC
Permalink
I don't have any problem with Windows build (without Cygwin). It's working
for me. I am just saying that the NDK overview is misleading about the
requirement of Cygwin.

Thanks
Post by Angel Segura
The NDK on windows works fine as of NDK-r6 version (I just move from it a
week ago).
a missing file, a corrupted file, a bad project configuration file. For a
fresh/clean kick start, I would recommend you the NVIDIA Tegra Android
Development SDK. It ussually comes with the latest working NDK version,
plus, the android SDK, plus, an installation with eclipse ready with the
CDT and ADT plugin to develop native activities. The eclipse IDE version of
the installation comes with a builtin plugin that has configured the post
steps to compile your code, so no need for a terminal window and having to
manage all those nasty configuration files.
I hope you can solve your problem.
Cheers.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/rOI-RWKBSRsJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
David Turner
2012-05-07 09:59:30 UTC
Permalink
Post by technicware
Digit,
Post by technicware
Thanks for the tip, but don't you see the contradiction? Using NDK on
Post by technicware
Windows requires Cygwin, but you must NOT put cygwin/bin in your Windows
PATH. I guess NDK look for Cygwin from the Windows registry.
- the NDK doesn't require Cygwin on Windows, you can build with
ndk-build.cmd from the Windows command prompt.
- however, when doing this, you should *not* have the Cygwin bin
directory in your path
It's nice to know NDK doesn't need Cygwin, but that contradicts what one
http://developer.android.com/sdk/ndk/overview.html
Windows is always mentioned with Cygwin. Perhaps the doc needs to be
updated (starting from which version NDK no longer require Cygwin).
Ah that's right, this documentation should be updated. Filed as
http://code.google.com/p/android/issues/detail?id=30347
Post by technicware
Post by technicware
I would make the BASH script ndk-build compatible with Cygwin and remove
Post by technicware
or marginalize ndk-build.cmd.
ndk-build should *already* compatible with Cygwin, or else it's a bug.
Please provide more information about why you can't use it in your setup,
for example what is the output of "ndk-build NDK_LOG=1" ?
Here is the output of building hello-jni in Cygwin bash prompt using the
/cygdrive/c/java/android-ndk-r7b>NDK=$PWD
/cygdrive/c/java/android-ndk-r7b>cd samples/hello-jni/
/cygdrive/c/java/android-ndk-r7b/samples/hello-jni>$NDK/ndk-build NDK_LOG=1
'/cygdrive/c/java/android-ndk-r7b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Found /bin/uname.exe on Windows host
Android NDK: uname -s returned: CYGWIN_NT-5.1
Android NDK: Cygwin detected: CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3)
2012-02-24 14:05 i686 Cygwin
Android NDK: Host operating system detected: cygwin
Android NDK: HOST_TAG set to windows-
Interesting, the problem is that the Host CPU detection failed (this should
dump "x86" or "x86_64"),
as a consequence, HOST_TAG is set to "windows-" instead of "windows" or
"windows-x86", and the rest fails because it can't find any toolchain
programs.

Looking at the build script's code, this looks like a bug. What does 'uname
-m' returns on your Cygwin shell exactly?

A work around is to define HOST_ARCH=x86 in your environment before calling
ndk-build. Hope this helps

Android NDK: Host tols prebuilt directory not found
Post by technicware
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'awk' tool: awk
Android NDK: Host 'awk' test returned: Pass
Android NDK: Probing for 'cygpath' program
Android NDK: 'cygpath' found as: /usr/bin/cygpath
/usr/lib => C:/cygwin/lib
/usr/bin => C:/cygwin/bin
/ => C:/cygwin
Android NDK: arm: armeabi armeabi-v7a
Android NDK: x86: x86
Android NDK: arm-linux-androideabi-4.4.3: armeabi armeabi-v7a
Android NDK: x86-4.4.3: x86
/cygdrive/c/java/android-ndk-r7b/platforms
Android NDK: Found supported platforms: android-14 android-3 android-4
android-5 android-8 android-9
Android NDK: PLATFORM android-14 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-14/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-14/arch-x86
Android NDK: PLATFORM android-3 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-3/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-3/arch-x86
Android NDK: PLATFORM android-4 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-4/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-4/arch-x86
Android NDK: PLATFORM android-5 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-5/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-5/arch-x86
Android NDK: PLATFORM android-8 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-8/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-8/arch-x86
Android NDK: PLATFORM android-9 supports: arm x86
/cygdrive/c/java/android-ndk-r7b/platforms/android-9/arch-arm
/cygdrive/c/java/android-ndk-r7b/platforms/android-9/arch-x86
Android NDK: Found stable platform levels: 14 3 4 5 8 9
Android NDK: Found max platform level: 14
Android NDK: Found project path: .
Android NDK: Parsing /cygdrive/c/java/android-ndk-r7b/build/core/
default-application.mk
Android NDK: Found APP_PLATFORM=android-8 in ./default.properties
Android NDK: Using build script ./jni/Android.mk
Android NDK: Application 'local' *is* debuggable
Android NDK: Selecting debug optimization mode (app is debuggable)
/cygdrive/c/java/android-ndk-r7b/sources
Android NDK: Building application 'local' for ABI 'armeabi'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for
'armeabi' ABI
Android NDK: Looking for imported module with tag 'cxx-stl/system'
Android NDK: Probing
/cygdrive/c/java/android-ndk-r7b/sources/cxx-stl/system/Android.mk
Android NDK: Found in
/cygdrive/c/java/android-ndk-r7b/sources/cxx-stl/system
Command not found
Command not found
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then
sed -e 's!^C:/cygwin/lib!/usr/lib!ig;s! C:/cygwin/lib!
/usr/lib!ig;s!^C:/cygwin/bin!/usr/bin!ig;s! C:/cygwin/bin!
/usr/bin!ig;s!^C:/cygwin/!/!ig;s! C:/cygwin/! /!ig;s!^D:!/cygdrive/d!ig;s!
D:! /cygdrive/d!ig;s!^C:!/c!ig;s! C:! /c!ig;' $1.org > $1 && rm -f $1.orgfi
------ end of script -----
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
No such file or directory
make: *** [obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 127
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-ndk/-/Vgmb8zWhFhwJ.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
technicware
2012-05-07 14:33:40 UTC
Permalink
Digit,

Here is the uname output on my Cygwin:

/c/java/android-ndk-r7c/build>uname -a
CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin

Score 2 bugs for a newbie, good for me :)

Thanks
Post by David Turner
Post by technicware
Digit,
It's nice to know NDK doesn't need Cygwin, but that contradicts what one
http://developer.android.com/sdk/ndk/overview.html
Windows is always mentioned with Cygwin. Perhaps the doc needs to be
updated (starting from which version NDK no longer require Cygwin).
Ah that's right, this documentation should be updated. Filed as
http://code.google.com/p/android/issues/detail?id=30347
Post by technicware
Here is the output of building hello-jni in Cygwin bash prompt using the
/cygdrive/c/java/android-ndk-r7b>NDK=$PWD
/cygdrive/c/java/android-ndk-r7b>cd samples/hello-jni/
/cygdrive/c/java/android-ndk-r7b/samples/hello-jni>$NDK/ndk-build NDK_LOG=1
'/cygdrive/c/java/android-ndk-r7b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Found /bin/uname.exe on Windows host
Android NDK: uname -s returned: CYGWIN_NT-5.1
Android NDK: Cygwin detected: CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3)
2012-02-24 14:05 i686 Cygwin
Android NDK: Host operating system detected: cygwin
Android NDK: HOST_TAG set to windows-
Interesting, the problem is that the Host CPU detection failed (this
should dump "x86" or "x86_64"),
as a consequence, HOST_TAG is set to "windows-" instead of "windows" or
"windows-x86", and the rest fails because it can't find any toolchain
programs.
Looking at the build script's code, this looks like a bug. What does
'uname -m' returns on your Cygwin shell exactly?
A work around is to define HOST_ARCH=x86 in your environment before
calling ndk-build. Hope this helps
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/BgzwB53tbQIJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
David Turner
2012-05-07 15:08:17 UTC
Permalink
Post by technicware
Digit,
/c/java/android-ndk-r7c/build>uname -a
CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin
Actually, I already know this (it's in the log above). I'm really curious
to know what the output of "uname -m" is though.
In theory, it should be "i686", and then the build script would detect this
as "x86" properly due to the following lines in build/core/init.mk

UNAME := $(shell uname -m)
ifneq (,$(findstring 86,$(UNAME)))
HOST_ARCH := x86
endif
# We should probably should not care at all
ifneq (,$(findstring Power,$(UNAME)))
HOST_ARCH := ppc
endif
ifeq ($(HOST_ARCH),)
$(call __ndk_info,Unsupported host architecture: $(UNAME))
$(call __ndk_error,Aborting)
endif

I.e. it would detect that the output contains a "86", and set HOST_ARCH to
"x86"
Note also that if HOST_ARCH was really empty, the script would abort with
an error. The fact that it didn't probably means that the value is a space
or something equally weird.

Score 2 bugs for a newbie, good for me :)
Post by technicware
Actually, not sure this is a bug in the script or in your cygwin config,
given that other people are capable of using this fine.
Quick question: Did you install Cygwin with Unix or DOS line-endings?
Anything fancy you selected during installation?
Post by technicware
Thanks
Post by technicware
Digit,
It's nice to know NDK doesn't need Cygwin, but that contradicts what one
http://developer.android.com/**sdk/ndk/overview.html<http://developer.android.com/sdk/ndk/overview.html>
Windows is always mentioned with Cygwin. Perhaps the doc needs to be
updated (starting from which version NDK no longer require Cygwin).
Ah that's right, this documentation should be updated. Filed as
http://code.google.com/p/**android/issues/detail?id=30347<http://code.google.com/p/android/issues/detail?id=30347>
Post by technicware
Here is the output of building hello-jni in Cygwin bash prompt using the
/cygdrive/c/java/android-ndk-**r7b>NDK=$PWD
/cygdrive/c/java/android-ndk-**r7b>cd samples/hello-jni/
/cygdrive/c/java/android-ndk-**r7b/samples/hello-jni>$NDK/**ndk-build
NDK_LOG=1
'/cygdrive/c/java/android-ndk-**r7b'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: windows
Android NDK: Found /bin/uname.exe on Windows host
Android NDK: uname -s returned: CYGWIN_NT-5.1
Android NDK: Cygwin detected: CYGWIN_NT-5.1 D430m 1.7.11(0.260/5/3)
2012-02-24 14:05 i686 Cygwin
Android NDK: Host operating system detected: cygwin
Android NDK: HOST_TAG set to windows-
Interesting, the problem is that the Host CPU detection failed (this
should dump "x86" or "x86_64"),
as a consequence, HOST_TAG is set to "windows-" instead of "windows" or
"windows-x86", and the rest fails because it can't find any toolchain
programs.
Looking at the build script's code, this looks like a bug. What does
'uname -m' returns on your Cygwin shell exactly?
A work around is to define HOST_ARCH=x86 in your environment before
calling ndk-build. Hope this helps
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-ndk/-/BgzwB53tbQIJ.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
technicware
2012-05-08 04:08:39 UTC
Permalink
Digit,
Post by technicware
...
Actually, I already know this (it's in the log above). I'm really curious
to know what the output of "uname -m" is though.
In theory, it should be "i686", and then the build script would detect
this as "x86" properly due to the following lines in build/core/init.mk
UNAME := $(shell uname -m)
/c/java/android-ndk-r7c>uname -m
i686
/c/java/android-ndk-r7c>echo =`uname -m`=
=i686=


I.e. it would detect that the output contains a "86", and set HOST_ARCH
to "x86"
Post by technicware
Note also that if HOST_ARCH was really empty, the script would abort with
an error. The fact that it didn't probably means that the value is a space
or something equally weird.
Score 2 bugs for a newbie, good for me :)
Post by technicware
Actually, not sure this is a bug in the script or in your cygwin config,
given that other people are capable of using this fine.
Quick question: Did you install Cygwin with Unix or DOS line-endings?
Anything fancy you selected during installation?
This Cygwin has been around for years. I am sure is in Unix line-ending.
Loading any of one of the bash scripts in c:/cygwin/bin into notepad
confirms that (shows one long wrapping line with no break).

Thanks
-----------
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/gb_HEZCjJHwJ.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Matt
2012-06-05 13:14:01 UTC
Permalink
I have the exact same problem. I'm running Cygwin on Windows 7 64-bit. My log
states that HOST_TAG is being set to windows- and uname -m returns "i686".

Did you all ever find a work around or fix for this? I tried setting
HOST_ARCH to x86 and that didn't change anything. The log for ndk-build is
the same.

I have a stackoverflow.com question about it here:
http://stackoverflow.com/questions/10887868/ndk-build-arm-linux-androideabi-gcc-
command-not-found
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
technicware
2012-06-05 14:23:47 UTC
Permalink
Matt,

Let me talk about Cygwin later. To build in Windows, open a *Windows
command window* (or cmd.exe, a.k.a. DOS prompt) and call *ndk-build.cmd*.
For example,

cd \java\android-ndk-r7c\samples\hello-jni
..\..\ndk-build

So far I found one bug about ndk-build.cmd. It cannot do clean. For example,

..\..\ndk-build clean
..\..\ndk-build

Does not rebuild the project. Compare it with a NDK running on Linux and
you will see the difference.

To build in Cygwin, two conditions must be met:

1) The Cygwin shell must be started from *cygwin.bat* from a *Windows
command window* (or cmd.exe, a.k.a. DOS prompt).

I run Cygwin openssh as a Windows service and login to Cygwin via SSH in
PuTTY. A bash shell opened like this *CANNOT* build NDK. The cygwin build
relies on environment variable setup by cmd.exe. Without the benefit of
your favorite terminal emulator like PuTTY, there is no point of building
on Cygwin.

2) The you must be the owner of everything the build reads/writes to. This
is the most bad-ass-aspect of building on Cygwin. To do this:

2a) You must have previously run mkpasswd on Cygwin to copy all Windows
user accounts into Cygwin.
2b) Run "ls -l" in the NDK directory and make sure your name is in the
owner column for all files and folders.
2c) Run "ls -l" in the external project directory and make sure your name
is in the owner column.

Now, you can build in Cygwin (btw clean also works):

/c/java/android-ndk-r7c/samples/hello-jni>../../ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Cygwin : Generating dependency file converter script
Compile thumb : hello-jni <= hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi/libhello-jni.so

--Michael
Post by Matt
I have the exact same problem. I'm running Cygwin on Windows 7 64-bit.
My log
states that HOST_TAG is being set to windows- and uname -m returns "i686".
Did you all ever find a work around or fix for this? I tried setting
HOST_ARCH to x86 and that didn't change anything. The log for ndk-build is
the same.
http://stackoverflow.com/questions/10887868/ndk-build-arm-linux-androideabi-gcc-
command-not-found<http://stackoverflow.com/questions/10887868/ndk-build-arm-linux-androideabi-gcc-command-not-found>
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/RjrxNTmpj58J.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Chris Stratton
2012-06-05 17:25:45 UTC
Permalink
Post by technicware
1) The Cygwin shell must be started from *cygwin.bat* from a *Windows
command window* (or cmd.exe, a.k.a. DOS prompt).
2) The you must be the owner of everything the build reads/writes to. This
2a) You must have previously run mkpasswd on Cygwin to copy all Windows
user accounts into Cygwin.
etc.

Probably not what you want to hear, but a few years before becoming
involved with android work, I went through the following progression
in developing for an embedded linux:

- Cygwin on company windows box

- Linux VM on company windows box

- This is silly. I now know how to mount smb shares even when they
have goofy names, I'm already using open office to exchange docs with
that guy with the old version of word whose files my version of word
chokes on, webmail more or less works, someone else took over the FPGA
aspect of the project, I can even cross-compile our windows firmer
updater tool from linux... so why don't I just run linux on my desk
and move the legacy tools to my lab bench machine?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Loading...