0

i'm trying to build a setup for game development(android) using VisualGDB and cocos2d-x. My problem is when i create a project using Third party library(Cocos2d-x) in VisualGDB i get the error "Toolchain test failed:cannot query the value of Target_cxx" If i ignore it and create project then after compliling i get the following error: enter image description here I have searched a lot allover the internet but nothing actually helped me. All i got is that i have to set some NDK_BUILD path in my Android.mk file Here is my Android.mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../cocos2d) 
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

#VisualGDBAndroid: AutoUpdateSourcesInNextLine
LOCAL_SRC_FILES := AppDelegate.cpp hellocpp/main.cpp HelloWorldScene.cpp   ../main-win32.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes

# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END


LOCAL_STATIC_LIBRARIES := cocos2dx_static

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

#VisualGDBAndroid: VSExcludeListLocation
VISUALGDB_VS_EXCLUDED_FILES_Debug__Android_ := ../main-win32.cpp
LOCAL_SRC_FILES := $(filter-out            $(VISUALGDB_VS_EXCLUDED_FILES_$(VGDB_VSCONFIG)),$(LOCAL_SRC_FILES))

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END

Ps: when i create a simple android project(not with cocos2d-x) using visualGDb then there is no error. Can any one please help me on this?

Fahid Nadeem
  • 412
  • 2
  • 7
  • 19

2 Answers2

1

There is no need to set ndk_build path in the android.mk file. You can do the same by two ways:

1.To build cocos2dx projects for android, you need to set 3 environment variables NDK_ROOT, ANDROID_SDK_ROOT and ANT_ROOT. I use MAC OS to build projects and i do the above through command line as follows:

export NDK_ROOT="/Users/Rajeev/Documents/AndroidDev/android-ndk-r10c"

You can search for the same how to do on windows.

2.Cocos2dx also provides its setup.py, a python script. If you run the script it will ask you all the above 3 paths and there will be no need to define them later.

Hope it will help.

Rajeev
  • 585
  • 3
  • 13
1

You should set your system environment variables and add NDK_ROOT to point to your Android NDK path. Take a look at this page and try to add NDK_ROOT to your system environment variables.

einverne
  • 6,454
  • 6
  • 45
  • 91