在cocos2DX多平台游戏环境中定义NDK_ROOT [英] define NDK_ROOT in cocos2DX mutiplatform game environment

查看:192
本文介绍了在cocos2DX多平台游戏环境中定义NDK_ROOT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用cocos2dx android,并且正在关注

I have just started working with cocos2dx android and I am following wonderful tutorial of http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started . Now, I have successfully run my first hello world demo project by following this link. I also set environment parameters:

NDK_ROOT_LOCAL="/MY ANDROID NDK PATH/"

ANDROID_SDK_ROOT_LOCAL="/MY ANDROID SDK PATH/"

我完全按照教程中的说明进行操作,但是第二次运行项目时仍然遇到问题,这意味着我每次必须从终端导出DNK_ROOT才能运行我的项目&这真的很累,似乎无法为我的进一步实现工作..虽然我已经定义了

I followed tutorial perfectly as given in it, still I am facing problem while running my project second time, means I have to export DNK_ROOT every time from terminal to run my project & it's really tired and seemed not working for my further implementation.. and while I run project it says please define NDK_ROOT though I already define

我还通过这种方式在.bash配置文件(create-android-project.sh)中手动定义这些变量

I also manually define these variables in my .bash profile (create-android-project.sh) this way

NDK_ROOT_LOCAL = "/MY ANDROID NDK PATH/"

ANDROID_SDK_ROOT_LOCAL = "/MY ANDROID SDK PATH/"

设置此功能时我想念什么?

What am I missing in setting up this?

推荐答案

要使这些变量成为永久变量(因此,您以后打开的每个终端外壳都必须具有),请使用您喜欢的文本编辑器来更新bash配置文件(我选择vi来保留它在终端中)

To make those variables permanent (so every terminal shell you open hereafter has then) use your favorite text editor to update your bash profile (I chose vi to keep it in the terminal)

注意:在路径中使用〜"只是您的用户目录的简写.在您的情况下,它似乎是说〜" ="/Users/alex"

NOTE: the use of "~" in a path is just shorthand for your user directory. In your case it appears to be synonymous with saying "~" = "/Users/alex"

vi ~/.bash_profile

添加以下行并保存(将这些名称和路径更新为 match 您的实际环境,我假设这里的所有内容都在您的用户目录的根目录中):

add the following lines and save (update these names and paths to match your actual environment, I am assuming everything is in the root of your user directory here):

export NDK_ROOT_LOCAL=~/android-ndk-r10b
export ANDROID_SDK_ROOT_LOCAL=~/sdk

使用在当前终端会话中运行配置文件,或者只是打开一个新终端

Use source to run the profile in the current terminal session or just open a new terminal

source ~/.bash_profile

您可以测试一下是否在此处定义了变量(使用您命名的变量)

You can test to see if the variables are defined here (use whatever you named them)

echo $NDK_ROOT_LOCAL

echo $ANDROID_SDK_ROOT_LOCAL

这篇关于在cocos2DX多平台游戏环境中定义NDK_ROOT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆