user1116700
user1116700

Reputation: 47

Android NDK Error using Cygwin: ERROR: GNUMAKE variable is defined to an invalid name

I am trying to build a static library using Android NDK. For this I have installed Cygwin & android-ndk-r7.

To build the library I have already created the required source file and Android.mk file. These files are located under "D:\NDK\test" on my machine.

My NDK Tools are installed under "C:\Android\android-ndk-r7" & Cygwin files are located under "C:\Cygwin\http%3a%2f%2fcygwin.mirrors.hoobly.com%2f". Hence there are no space in any of the locations.

For building the library, I launch Cygwin and point it to the location where my source files and Android.mk file is located. Then to give the build command I type "/cygdrive/c/Android/android-ndk-r7/ndk-build". On giving the above command, I get an error message:

ERROR: Cannot find 'make' program. Please install Cygwin make package or define the GNUMAKE variable to point to it.

I went through several blogs and followed the solutions on them:

  1. Install make under Devel folder in Cygwin installation. This didnt do any change.

  2. Create an Environmental Variable GNUMAKE and define it as /usr/bin/make. I also tried defining this variable to different locations:

    C:\Cygwin\http%3a%2f%2fcygwin.mirrors.hoobly.com%2f\bin
    C:\Android\android-ndk-r7\prebuilt\windows\bin
    C:\Android\android-ndk-r7

    But with each I got the same error:

    ERROR: Your GNUMAKE variable is defined to an invalid name: C:\Android\android-ndk-r7 Please fix it to point to a valid make executable (e.g. /usr/bin/make)

So it looks like I am not pointing the path correctly. Can someone please tell me which path should GNUMAKE point to.

I also did make -v on my Cygwin prompt and the below message pops up (which makes me believe that everything related to Cygwin installation is fine):

$ 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 Windows32

Thanks for your help.

Upvotes: 1

Views: 6188

Answers (2)

Haseeb
Haseeb

Reputation: 11

i worked hard on error in gygwin terminal "gnumake variable is define to invalid name" and after that i get to the point that we simply remove this error by deleting the GNUMAKE path in environment variable both in system and user variable if u created it....

mycomputer > system properties > advanced system setting > environment variable

Upvotes: 1

Phonon
Phonon

Reputation: 12727

Starting with NDKr7, you don't need Cygwin anymore to build libraries. Here's the simpler way.

  1. In command prompt, navigate to your project directory: cd D:\NDK\test
  2. Make sure your native code and Android.mk are in the jni folder of that directory
  3. Call ndk-build: C:\Android\android-ndk-r7\ndk-build

This should do it all for you.

Upvotes: 13

Related Questions