Eclipse ADT上的Cocos2d-x C ++构建错误 [英] Cocos2d-x C++ build error on Eclipse ADT

查看:201
本文介绍了Eclipse ADT上的Cocos2d-x C ++构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Cocos2d-x C ++的新手。我试图运行,然后调试cocos2d-x 2.2.1在我的Mac上的示例代码HelloCpp。下面是我做的:

I'm newbie of Cocos2d-x C++. I tried to run then debug the sample code HelloCpp of cocos2d-x 2.2.1 on my Mac. The following is what I did:

1。设置环境变量:NDK_TOOLCHAIN_VERSION,NDK_ROOT,ANDROID_SDK_ROOT,COCOS2DX_ROOT,...

1 . Set environment variables: NDK_TOOLCHAIN_VERSION, NDK_ROOT, ANDROID_SDK_ROOT, COCOS2DX_ROOT, ...

我可以从终端运行build_native.sh没有错误。

I can run build_native.sh from Terminal without errors.

2。将C ++类添加到项目

2 . Add C++ classes to project

HelloCpp是一个C ++项目,因此我忽略了在Eclipse中将此项目转换为C / C ++项目。

HelloCpp is a C++ project already so I ignored converting this project to C/C++ project in Eclipse.

C ++类已成功添加到项目中。

C++ classes added to project successfully.

3。更改项目设置以指定如何运行make命令

3 . Change the project settings to specify how to run make command

In My project -> Properties -> C/C++ Build -> Builder Setting:
   Set "Build command" = /bin/bash ${ProjDirPath}/build_native.sh NDK_DEBUG=1 V=1

In My project -> Properties -> C/C++ Build -> Builder Setting -> Tool Chain Editor:
   Set "Current toolchain" = Android GCC
   Set "Current builder" = Gnu Make Builder

4。将项目作为Android应用程序运行。我收到以下错误:

4 . Run project as an Android Application. I got these errors:

.../cocos2d-x-2.2.1/samples/Cpp/HelloCpp/proj.android/build_native.sh: line 68: mkdir: command not found

.../ADT/adt-bundle-mac-x86_64-20130917/android-ndk-r9b//ndk-build: line 40: dirname: command not found

.../cocos2d-x-2.2.1/samples/Cpp/HelloCpp/proj.android/build_native.sh: line 33: dirname: command not found

.../cocos2d-x-2.2.1/samples/Cpp/HelloCpp/proj.android/build_native.sh: line 52: dirname: command not found

.../ADT/adt-bundle-mac-x86_64-20130917/android-ndk-r9b//ndk-build: line 132: uname: command not found

我搜索了很多,但无法解决错误。我在某个地方错了。感谢您的帮助。

I searched a lot but cannot resolved errors. I was wrong somewhere. Thank you for your help.

推荐答案

我列出了所有的可能性导致错误,同时在eclipse中构建cocos2d-x 这里在我的博客。希望它帮助你。如果问题仍然无法解决,请与我们联络。

I've listed all the possibilities to cause error while building cocos2d-x in eclipse here in my blog. Hope it helps you. Let me know if it still doesn't fix your issue.

这篇关于Eclipse ADT上的Cocos2d-x C ++构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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