Reputation: 55
I have included the cocos-ext.h in one of my header files and added the extension namespace. Visual studio has no issue with the code, successfully finding it, however, when I go into the terminal and try to compile for android, it says file cannot be found in the extention include file. Is there somewhere I need to put the file? Or add it to Android.mk?
I am running cocos2d-x 3.0r2 with code in C++
Thanks.
Upvotes: 1
Views: 1961
Reputation: 167
FYI Since I was having this problem as well:
Include:
#include "cocos-ext.h"
In Android.mk make sure you have:
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
$(call import-module,extensions)
AND:
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../extensions
to wherever extensions is for you.
Hopefully this helps.
Original Post: http://www.cocoachina.com/bbs/simple/?t201982.html
Upvotes: 0
Reputation: 8720
If anyone else encounters this problem, check this page: cocos forums
The meat of it is to include the header at the top of your file:
#include "extensions/cocos-ext.h"
Then add the extensions to the Android.mk file in the jni folder:
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static // add this
include $(BUILD_SHARED_LIBRARY)
$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)
$(call import-module,extensions) // add this
Upvotes: 1
Reputation: 1029
Are your header search paths set for compiling from a terminal? I'd check Visual Studio for where it is searching and make sure the same path is set when compiling from the terminal.
Have a look here: http://cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Android
Upvotes: 0