在Windows 8上使用Cygwin执行.sh文件时出错


1

我是Cygwin终端机的初学者。我正在尝试使用Windows 8在Windows 8上运行* .sh文件./file_name.sh,但它显示以下错误。

使用预建的外部

错误:找不到“ make”程序。请安装Cygwin make软件包或定义GNUMAKE变量以指向它。

我已在F驱动器上安装了Cygwin。我用Google搜索这个错误,并设置在变量path 计算机属性高级系统属性环境变量Path编辑和可变的路径;F:\cygwin\bin,但不起作用。我怎么解决这个问题?

这是我的file_name.sh脚本:

# set params
NDK_ROOT=/cygdrive/f/Android/android-ndk-r9b
COCOS2DX_ROOT=/cygdrive/f/Android/cocos2d-2.0-rc2-x-2.0.1
GAME_ROOT=$COCOS2DX_ROOT/molatx
GAME_ANDROID_ROOT=$GAME_ROOT/proj.android
RESOURCE_ROOT=$GAME_ROOT/Resources

buildexternalsfromsource=

usage(){
cat << EOF
usage: $0 [options]

Build C/C++ native code using Android NDK

OPTIONS:
   -s   Build externals from source
   -h   this help
EOF
}

while getopts "s" OPTION; do
    case "$OPTION" in
        s)
            buildexternalsfromsource=1
            ;;
        h)
            usage
            exit 0
            ;;
    esac
done

# 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

# copy icons (if they exist)
file=$GAME_ANDROID_ROOT/assets/Icon-72.png
if [ -f "$file" ]; then
    cp $file $GAME_ANDROID_ROOT/res/drawable-hdpi/icon.png
fi
file=$GAME_ANDROID_ROOT/assets/Icon-48.png
if [ -f "$file" ]; then
    cp $file $GAME_ANDROID_ROOT/res/drawable-mdpi/icon.png
fi
file=$GAME_ANDROID_ROOT/assets/Icon-32.png
if [ -f "$file" ]; then
    cp $file $GAME_ANDROID_ROOT/res/drawable-ldpi/icon.png
fi


if [[ $buildexternalsfromsource ]]; then
    echo "Building external dependencies from source"
    $NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT \
        NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source
else
    echo "Using prebuilt externals"
    $NDK_ROOT/ndk-build -C $GAME_ANDROID_ROOT \
        NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt
fi

欢迎来到超级用户!发布前,请确保您的问题可读。使用格式指示代码块或带引号的消息。大写“ I”,在UI消息中标记标签,并确保它们已经与UI匹配。我为您改善了您的问题。
gronostaj

看来这不是您的问题,但是您可能想养成引用所有变量引用的习惯;例如"$file""$GAME_ANDROID_ROOT""$NDK_ROOT",和"$COCOS2DX_ROOT"。顺便说一句,只有在变量后跟字母,数字或冒号时才需要花括号,因此可以说NDK_MODULE_PATH="${COCOS2DX_ROOT}:$COCOS2DX_ROOT/cocos2dx/platform/third_party/android/source"
斯科特,

Answers:


1

似乎未安装Cygwin的“ make”软件包。尝试安装它,然后运行脚本。以cyg-apt为例。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.