Hiya guys! I kinda new, and I hope I don’t screw up before asking stuff. I’m trying to get Cocos2DX working on an Android project and I stumbled upon something while trying to run the build_native.sh under Cygwin, as said in the official tutorial:
[[http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter_1_~~_How_to_Create_a_New_cocos2d-x_project_on_multi-platforms#412-Build-native-code]]
What happens is that I do the same thing on my Cygwin terminal, and this pops up:
<pre>
$ ./build_native.sh
./build_native.sh: line 7: $’‘: command not found
./build_native.sh: line 17: syntax error near unexpected token `$’do\r’‘
’/build_native.sh: line 17: `do
</pre>
Does anyone know why this happens? Thanks a bunch!
EDIT: Ok, I think I needed to specify how my code was on this, since I didn’t know if this is a common error or not, but if anything, here goes my build_native.sh code:
<pre>
# set params
ANDROID_NDK_ROOT=/cygdrive/c/android-ndk-r7/
COCOS2DX_ROOT=/cygdrive/c/cocos2d-1.0.1-x-0.10.0/
GAME_ROOT=$COCOS2DX_ROOT/TSP/
GAME_ANDROID_ROOT=$GAME_ROOT/android/
RESOURCE_ROOT=$GAME_ROOT/Resources/
# make sure assets is exist
if [~~d $GAME_ANDROID_ROOT/assets ]; then
rm ~~rf $GAME_ANDROID_ROOT/assets
fi
mkdir $GAME_ANDROID_ROOT/assets
# copy resources
for file in $RESOURCE_ROOT/*
do
if [~~d $file ]; then
cp ~~rf $file $GAME_ANDROID_ROOT/assets
fi
if [~~f $file ]; then
cp $file $GAME_ANDROID_ROOT/assets
fi
done
- build
$ANDROID_NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT $*
</pre>
*SOLUTION ON REPLY #2