繁体   English   中英

如何使用cygwin在Windows上运行.sh文件?

[英]how to run .sh file on windows using cygwin?

我是cygwin Terminal的初学者。 我正在尝试使用命令./file_name.sh在Windows 8上运行*.sh文件,但是它给出以下错误。

Using prebuilt externals

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

我已在F驱动器中安装了cygwin ,我用google搜索了此错误,并在computer properties > advance system properties > variable environment > path >edit设置了变量路径,变量路径为;F:\\cygwin\\bin但不起作用。 我怎么解决这个问题??

这是我的剧本

`# 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

您必须使用cygwin“ setup.exe”向导安装make软件包。 检查您的脚本正在编译哪种编程语言,因为该语言的编译器还将是您脚本的依赖项。

可能您也需要安装一些库。

Windows系统路径与Cygwin路径不同。 如果您使用cygwin安装程序安装所需的软件包,则它们已在$ PATH中可用。

运行cygwin setup进行安装:make,automake,gcc,gcc-c ++

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM