【问题标题】:Cocos2dx bash Error build_native.shCocos2dx bash 错误 build_native.sh
【发布时间】:2019-01-22 23:04:28
【问题描述】:

您好,我是 cocos2dx 的新手。我在 Windows 7 / Eclipse 中配置 cocos2dx。我创建了一个正在运行的名为 helloworld 的项目,但是当我运行示例项目 (helloCpp, testCpp) 时出现错误:

bash /build_native.sh 
Cannot run program "bash": Launching failed
Error: Program "bash" not found in PATH

我已经尝试过Cocos2d-x android can't resolved coscos2dx library

【问题讨论】:

    标签: android eclipse cocos2d-x


    【解决方案1】:

    相信我 我一直在尝试在 Windows 机器上设置 cocos2dx 大约 2 周,但我根本没有成功。我遇到了很多问题,还有编译 CPP 代码和构建路径问题的问题。 切换到 MAC 更容易,最重要的是,制作跨平台应用程序窗口没有任何意义,因为您无法在 Windows 机器上运行 iOS 模拟器

    【讨论】:

    • 你是否试图用正确的语法编译它我的意思是它的 ./build_native.sh 而不是 /build_native.sh
    • 同意。 Mac 更容易。
    • 是的,我做得对。/build_native.sh 但是当我使用运行成功的 create-android-project 创建新项目时。我认为 bash 的一些路径问题,但在哪里?
    • 环境变量需要设置为 c:/cygwin/bin
    【解决方案2】:

    设置环境变量(c:/cygwin/bin),问题就解决了

    【讨论】:

      【解决方案3】:

      所有环境变量设置正确。 环境变量列表为:Android SDK 路径、Python 和 Apache Ant。 然后尝试在命令提示符上运行 ./build_native.sh。 参考链接:Here

      【讨论】:

        【解决方案4】:

        你需要一个正确的版本

        Cocos2d-x 3.6 阿帕奇蚂蚁 蟒蛇2.7 蚀 爪哇

        1.Set Java and Apache Path in Global Environment 
        2.Extract cocos2d-x 3.6 Download Version
        3.Open the setup.py file
        4. add this all in Environment File 
        
        COCOS_CONSOLE_ROOT = 'COCOS_CONSOLE_ROOT' => Here is your File where you are add
        COCOS_X_ROOT = 'COCOS_X_ROOT' => you get this in Cocos2dx Folder
        COCOS_TEMPLATES_ROOT = 'COCOS_TEMPLATES_ROOT'=> you get this in cocos2dx Folder
        NDK_ROOT = 'NDK_ROOT' => Download NDK 9.2
        ANDROID_SDK_ROOT = 'ANDROID_SDK_ROOT'=> your Eclipse root
        ANT_ROOT = 'ANT_ROOT' => apache ant root`enter code here`
        

        首先添加 Proper in Environment 然后运行 ​​CMD,干杯 :)!

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多