How to add mm file to

How to add mm file to
0.0 0


I create an mm file which works fine in Xcode, but cannot work in Eclipse when I build it for Android project.

String* UtilityTool::getValue()
String* currentValue = new String(“”);
//Objective-C codes
//Android codes
return currentValue;

I add these codes in which can drive NDK compile mm as c**,

but it always report error as:
/Users/xxxx/Documents/GameStudio/cocos2d-x-3.0alpha0/projects/PopStarDeluxe/…/…/…/cocos2dx/platform/android/nativeactivity.cpp:121: error: undefined reference to ‘cocos_android_app_init(android_app*)’

If I change the extension to cpp, it works fine. How to resolve this problem?


.mm is objective C++ and isn’t applicable for Android.

My setup is like this:

NativeInterface.cpp (C++) [includes, in CC_TARGET_PLATFORM ifs, IOSHelper and AndroidHelper]
IOSHelper.h / [only used in XCode]
AndroidHelper.h / AndroidHelper.cpp [used in Android, has JNI, etc]