Cygwin for Android-NDK programming

18,823

Solution 1

Android NDK starting with revision 7 doesn't require Cygwin. See here: http://developer.android.com/sdk/ndk/index.html

You can now build your NDK source files on Windows without Cygwin by calling the ndk-build.cmd script from the command line from your project path. The script takes exactly the same arguments as the original ndk-build script. The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other tools required by the build. You should not need to install anything else to get a working build system.

It mentions you can not use ndk-gdb script without Cygwin. While that is true, you can actually use gdb executable directly without Cygwin, only then you'll need to set it up properly manually.

Solution 2

  1. At least NDK-r8b, if you want to build your .so, you don't need Cygwin.
  2. However, if you want to use ndk-gdb to debug your native code,you have to use Cygwin.
  3. And, in my experiment, if you ndk-gdb your native under Cygwin to debug native code which is built from windows cmd, ndk-gdb seems cannot recognize the debug info. So, for debug purpose, I build native Cygwin.

Solution 3

(from NDK-r8e NDK-GDB document) At the moment 'ndk-gdb' requires a Unix shell to run. This means that Cygwin is required to run it on Windows. We hope to get rid of this limitation in a future NDK release.

Solution 4

Make command to execute Android.mk file.

Android.mk file consists of list of c/c++ files to be compiled and also the library name(.so).

Share:
18,823
AbhishekB
Author by

AbhishekB

Updated on June 04, 2022

Comments

  • AbhishekB
    AbhishekB almost 2 years

    I read about the requirements of NDK programming on Windows which said we require Cygwin.Read about Cygwin which said we require it coz it is a way to make Windows support some linux functionality.But my question is in which stage of programming(Where Exactly) Cygwin will be required and why? Addidtional info about this topic is most welcomed

  • AbhishekB
    AbhishekB almost 12 years
    Thanks for the quick reply.But can u tell me some more about it in detail and also it would be very nice if u tell the source of ur ans.
  • Mohammed Azharuddin Shaikh
    Mohammed Azharuddin Shaikh almost 12 years
  • AbhishekB
    AbhishekB almost 12 years
    Superb.. could build my application without using cygwin..Thanks...Can u comment more on this part of ur answer " It mentions you can not use ndk-gdb script without Cygwin. While that is true, you can actually use gdb executable directly without Cygwin "
  • Mārtiņš Možeiko
    Mārtiņš Možeiko almost 12 years
    You can read the ndk-gdb script to see whats it is doing. It is not that hard. Its something like this: mhandroid.wordpress.com/2011/01/25/… or kandroid.org/online-pdk/guide/debugging_gdb.html It's standard setup for remote debugging with gdb and gdbserver.
  • John
    John almost 12 years
    I concur, having read: stackoverflow.com/a/8384324/866333. However Mastins' quoted paragraph is not present at the original link target. Instead, I'm reading: "Required development tools For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU Make might work but have not been tested. A recent version of awk (either GNU Awk or Nawk) is also required. For Windows, Cygwin 1.7 or higher is required. The NDK will not work with Cygwin 1.5 installations."
  • xverges
    xverges over 11 years
    @John I see the quoted text in the Android NDK, Revision 7 (November 2011) section of the link, under the subheading Experimental Features
  • John
    John over 11 years
    You are right, but I maintain the evidence was initially lacking.
  • yahya
    yahya over 10 years
    You saved my lots of time to download cygwin and tones of MB :) Thanks a lot!