Can't build with "build_native.py" after including "extensions/cocos-ext.h"

Can’t build with “build_native.py” after including “extensions/cocos-ext.h”
Showing error message :
fatal error: extensions/cocos-ext.h: No such file or directory
#include “extensions/cocos-ext.h”
^
compilation terminated.

I’m using cocos2d-x-3.0beta2

Check your Android.mk
cocos extension static must be included.

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

include $(BUILD_SHARED_LIBRARY)

$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)
$(call import-module,extensions)

I have the same problem, and i had exactly the same as barisatamer suggested on my .mk file
Any other suggestions?

Fixed. I had to replace my
#include "cocos-ext.h"
by
#include "extensions/cocos-ext.h"

@barisatamer
Thanks! That solved my problem.

@javi_moralesf wrote:

Fixed. I had to replace my
#include "cocos-ext.h"
by
#include "extensions/cocos-ext.h"

Thanks, it helped in my case. Does not it look like a bug in cocos2d-x?

@javi_moralesf wrote:

Fixed. I had to replace my
#include "cocos-ext.h"
by
#include "extensions/cocos-ext.h"

Yeah, that works. But does it rise conflicts with iOS version? We are building a cross-platform game and, by the moment, we did something like this:

#if(CC_PLATFORM_ANDROID == CC_TARGET_PLATFORM)
	#include "extensions/cocos-ext.h"
#elif(CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
	#include "cocos-ext.h"
#endif

I have done all the changes proposed and still get the error. Now it’s

jni/…/…/Classes/…/MainScene.cpp:21:10: fatal error: ‘extensions/cocos-ext.h’ file not found
#include “extensions/cocos-ext.h”
^
Any other suggestion?

dont make all the changes

just make these changes over here in the link

you need to uncomment these

 # LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

to

LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

and

.$(call import-module,extensions)

to

$(call import-module,extensions)

and #include "extensions/cocos-ext.h" where you want the extensions to be.

on the first build it will compile all the extensions file.
i recently got over these while working with extensions, nothing other than these
trust me…

If you still face issues… then tell us the exact error you are getting
we will help you. :smile:

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