我有一个混合编码的mm文件,在xcode下执行良好
String* UtilityTool::getValue()
{
String* currentValue = new String("");
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//Objective-C codes
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
//Android codes
#endif
return currentValue;
}
```
在编译到android上时,我在Android.mk中做了如下修改
LOCAL_CPP_EXTENSION += .mm
LOCAL_CFLAGS += -x c++
使得NDK可以编译mm文件,但是总是报错:
/Users/xxxx/Documents/GameStudio/cocos2d-x-3.0alpha0/projects/PopStarDeluxe/proj.android/../../../cocos2dx/platform/android/nativeactivity.cpp:121: error: undefined reference to 'cocos_android_app_init(android_app*)'
如何修改才能顺利讲这个问题解决呢?