Android + Windows + Cygwin. Blank project won't compile

I am trying to compile a blank Android project and getting errors right off the bat. I am using the latest 2.1.1 release. I get up to the build_native.sh step and then this happens.

$ ./build_native.sh
NDK_ROOT = /ndkroot/
COCOS2DX_ROOT = /cocos2d21/MiniMixMayhem/proj.android/../..
APP_ROOT = /cocos2d21/MiniMixMayhem/proj.android/..
APP_ANDROID_ROOT = /cocos2d21/MiniMixMayhem/proj.android
Using prebuilt externals
make: Entering directory `/cocos2d21/MiniMixMayhem/proj.android'
/ndkroot/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Cygwin         : Generating dependency file converter script
Compile++ thumb  : game_shared <= main.cpp
In file included from jni/hellocpp/main.cpp:1:0:
jni/../../Classes/AppDelegate.h:4:27: fatal error: CCApplication.h: No such file or directory
compilation terminated.
/ndkroot/build/core/build-binary.mk:269: recipe for target `obj/local/armeabi/objs/game_shared/hellocpp/main.o' failed
make: *** [obj/local/armeabi/objs/game_shared/hellocpp/main.o] Error 1
make: Leaving directory `/cocos2d21/MiniMixMayhem/proj.android'

I have set up NDK_ROOT and the cocos2dx folders.

The folders /ndkroot, and /cocos2d21 are mounted windows folders inside cygwin. (The folders can’t be accessed through /cygdrive without going through a space)

The problem is that the compiler can’t find CCApplication.h. So I tried using cocos2d.h instead, but got the same error. So I decided to just include the file by pathname:

#include "/cocos2d21/cocos2dx/include/cocos2d.h"

and verify that the file does exist:

$ ls /cocos2d21/cocos2dx/include/cocos2d.h
/cocos2d21/cocos2dx/include/cocos2d.h

But the compiler STILL can’t it! Nor can it find any of the cocos2d header files, and dies in the same way:

jni/../../Classes/AppDelegate.h:4:49: fatal error: /cocos2d21/cocos2dx/include/cocos2d.h: No such file or directory
compilation terminated.

Is there a specific way that the compiler is searching for header files that I don’t understand?

have you done “chmod 0755 -Rf .”(give permissions) before build it in cygwin?

I met with exactly the same problem today and solved it by luck.

In my Cygwin environment, I used a symbolic link to shorten drive paths like:
~/c > /cygdrive/c
~/d
> /cygdrive/d

If you are using the same trick and came with the same problem, try use the full path not the symbolic link one!
That works for me.