[SOLVED] "build_native.sh" refuses to work :(

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

  1. build
    $ANDROID_NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT $*
    </pre>

*SOLUTION ON REPLY #2

Open file in any powerful text editor and make EOL conversion, this file must have UNIX-like format.

For example: Open build_native.sh in Notepad++ and use menu Edit~~>EOL Conversion~~>Convert to UNIX format.

*It worked![](* Thanks a lot Marat ;D

FYI, I used WinSyntax 2.0 and also did the trick :slight_smile:

After changing the format of the file, I found an error with the AWK application from the Android NDK, which I solved by overriding its use, following what was said in “this post”:http://www.cocos2d-x.org/boards/10/topics/6264?r=6452#message-6452 .

Now I’m facing some issues with the use of SimpleAudioEngine.h in the example, but I think I can sort it out.
Again thanks) :smiley:

if i change t format using notepad++ to a unix format , i get an error stating no such file or directory

You should check the path.
May be you should paste error message.