Cocos2d-x about Android. mk automatically read CPP, cocos2dandroid. mk
* *********************************** Please specify the source: bytes ********************************************
I know the development of cocos2d-x games,
When everything is done,
The last step is to generate the APK,
In the past, we used NDK and so on, which is very complicated to do,
After 3.0, you can directly create it in the command line cocos compile.
It is much simpler.
However, there is still something to do manually,
For example, fill in the. cpp file in the Android. mk file,
In this file, we need to add all the. cpp files used in our program.
If there are few files, you can also, but there are more files, it is very painful.
This can be solved in just three lines!
This is simple:
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := cocos2dcpp_sharedLOCAL_MODULE_FILENAME := libcocos2dcppFILE_LIST := hellocpp/main.cpp FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../ClassesLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_staticLOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_staticLOCAL_WHOLE_STATIC_LIBRARIES += box2d_staticinclude $(BUILD_SHARED_LIBRARY)$(call import-module,2d)$(call import-module,audio/android)$(call import-module,Box2D)
That's right. There are three rows in the middle:
FILE_LIST := hellocpp/main.cpp FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
Well, in the future, mom will no longer have to worry about making cocos games!
* *********************************** Please specify the source: bytes ********************************************
Problems with COCOS2DX packaging android
What is cygwin compiled by you?
Now developing android games with cocos2d-x22, ask how to breakpoint debug to cpp file c ++ code
I am debugging in the win32 project. After debugging, I can go to android for testing. Debugging c ++ directly in android has not been tried yet.