How do i run the ndk-build in from my windows?

7,525 views
Skip to first unread message

soul_killer

unread,
Sep 6, 2011, 10:12:49 PM9/6/11
to android-ndk
i was trying to set-up the Augmented Reality(AR) for my sample android
AR project thru my eclipse, according to this URL:
https://ar.qualcomm.at/qdevnet/sdk/android

When it comes to set up the Android-NDK, I was stuck.
I have followed the steps provided here...

https://ar.qualcomm.at/qdevnet/sdk/android/325

1) download the android-ndk-r6b
2) My android ndk folder is located here: C:\Program Files\Android\
Its in the same directory as my android sdk & qcar-android-1-0-6.
3) My workspace is located here: D:\MY_ANDROID_WS

I tried to go to command prompt and go into my android ndk location
and run the build. But its not running.
Keep throwing me this error.

C:\Program Files\Android\android-ndk-r6b>ndk-build
'ndk-build' is not recognized as an internal or external command,
operable program or batch file.

What should i do actually?
How do i run my ndk-build??
please help....

mingw android

unread,
Sep 7, 2011, 5:10:39 AM9/7/11
to andro...@googlegroups.com
You need to use Cygwin.

> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To post to this group, send email to andro...@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.
>
>

mag g

unread,
Sep 7, 2011, 5:14:42 AM9/7/11
to andro...@googlegroups.com
Hi,

yes you are right..at last i managed to run it. But now im having different error in Cygwin console when tryin to run the ndk-build command.

Its showin me this error:

$ ndk-build
/cygdrive/c/Android/android-ndk-r6b/build/core/setup-toolchain.mk:109: *** target pattern contains no `%'.  Stop.

Info: I am using GNU Make 3.81.

Please help...

Adrian Vintu

unread,
Sep 7, 2011, 8:16:10 AM9/7/11
to andro...@googlegroups.com
Hi mag,

It's probably a space in path issue. As the link you provided says, install the Android SDK/NDK to a location that does NOT contain spaces - i.e. NOT in /Program Files/

Also, install the QCAR kit to a path without spaces.

I have just tested the compilation of the QCAR samples with ndk 6b and works just fine.

Best regards,
Adrian Vintu
http://adrianvintu.com

Adrian Vintu

unread,
Sep 7, 2011, 8:20:13 AM9/7/11
to andro...@googlegroups.com
You should have something like this:

avintu@AVINTU /cygdrive/c/Development/Android/qcar-android-1-0-6/samples/MultiTarget
$ ndk-build
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup       : libs/armeabi-v7a/gdb.setup
Compile++ arm    : MultiTargets <= MultiTargets.cpp
Compile++ arm    : MultiTargets <= SampleUtils.cpp
Compile++ arm    : MultiTargets <= Texture.cpp
StaticLibrary  : libstdc++.a
Prebuilt       : libQCAR.so <= jni/../../../build/lib/armeabi/
SharedLibrary  : libMultiTargets.so
Install        : libMultiTargets.so => libs/armeabi/libMultiTargets.so
Install        : libQCAR.so => libs/armeabi/libQCAR.so
Compile++ arm    : MultiTargets <= MultiTargets.cpp
Compile++ arm    : MultiTargets <= SampleUtils.cpp
Compile++ arm    : MultiTargets <= Texture.cpp
StaticLibrary  : libstdc++.a
Prebuilt       : libQCAR.so <= jni/../../../build/lib/armeabi-v7a/
SharedLibrary  : libMultiTargets.so
Install        : libMultiTargets.so => libs/armeabi-v7a/libMultiTargets.so
Install        : libQCAR.so => libs/armeabi-v7a/libQCAR.so


Best regards,
Adrian Vintu
http://adrianvintu.com


mag g

unread,
Sep 21, 2011, 1:57:24 AM9/21/11
to andro...@googlegroups.com
Hi adrian,

Im still not able to run my ndk-build.
Im still getting the error:


$ ndk-build
/cygdrive/c/Android/android-ndk-r6b/build/core/setup-toolchain.mk:109: *** target pattern contains no `%'.  Stop.

I didn't see any spaces in my paths.

My sdk, ndk and qcar located here:
C:\Android\android-sdk
C:\Android\android-ndk-r6b
C:\Android\qcar-android-1-0-6


My Cygwin located here:
C:\cygwin\

Please help... :-((

Adrian Vintu

unread,
Sep 21, 2011, 6:39:26 AM9/21/11
to andro...@googlegroups.com
Hi mag,

I still think it's a path issue. Could be an old make.exe version, like here http://stackoverflow.com/questions/2401976/very-simple-application-fails-with-multiple-target-patterns-from-eclipse

Please update Cygwin and make.exe and run some commands like below, and copy/paste the output. Please notice my Cygwin version and make.exe. I am trying to always have the latest version.

c:\Development\Android\qcar-android-1-0-6\samples\VirtualButtons>set path=d:\cygwin\bin;d:\development\android\android-sdk-windows;d:\develo
pment\android\android-sdk-windows\tools;d:\development\android\android-ndk;

c:\Development\Android\qcar-android-1-0-6\samples\VirtualButtons>bash

avintu@AVINTU /cygdrive/c/Development/Android/qcar-android-1-0-6/samples/VirtualButtons

$ ndk-build
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi-v7a/gdbserver
Gdbsetup       : libs/armeabi-v7a/gdb.setup
Install        : libQCAR.so => libs/armeabi/libQCAR.so
Install        : libVirtualButtons.so => libs/armeabi/libVirtualButtons.so
Install        : libQCAR.so => libs/armeabi-v7a/libQCAR.so
Install        : libVirtualButtons.so => libs/armeabi-v7a/libVirtualButtons.so

avintu@AVINTU /cygdrive/c/Development/Android/qcar-android-1-0-6/samples/VirtualButtons
$ uname -a
CYGWIN_NT-6.1-WOW64 AVINTU 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin

avintu@AVINTU /cygdrive/c/Development/Android/qcar-android-1-0-6/samples/VirtualButtons
$ java -version
bash: java: command not found

avintu@AVINTU /cygdrive/c/Development/Android/qcar-android-1-0-6/samples/VirtualButtons
$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-cygwin


Best regards,
Adrian Vintu
http://adrianvintu.com


soul_killer

unread,
Sep 22, 2011, 1:50:03 AM9/22/11
to android-ndk
Hi Adrian,

I think you was right that its something to do with my path issue.

I tried everything from scratch again by following all the steps
provided and it worked like a charm!
https://ar.qualcomm.at/qdevnet/sdk

Actually i missed out to set the environment variable for android sdk
(tools and platform-tools) which i think the root cause i wasn't able
to run my ndk-build in cygwin.

At the end, all these paths need to be set to Path variable in
Environment Variables:

C:\Android\android-sdk\tools\;
C:\Android\android-sdk\platform-tools\;
C:\cygwin\bin\;
C:\Android\android-ndk-r6b\

Thanks a lot to Adrian and Ming !! ;-)

Adrian Vintu

unread,
Sep 22, 2011, 9:05:35 AM9/22/11
to andro...@googlegroups.com
My pleasure, soul_killer :)


Best regards,
Adrian Vintu
http://adrianvintu.com



--
Reply all
Reply to author
Forward
0 new messages