问题描述
- cocos2d-x移植Android平台 Jni/hellocpp/main.cpp报错
-
#include "AppDelegate.h"
#include "cocos2d.h"
#include "CCEventType.h"
#include "platform/android/jni/JniHelper.h"
#include
#include#define LOG_TAG "main"
#define LOGD(...) android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,VA_ARGS__)using namespace cocos2d;
extern "C"
{jint JNI_OnLoad(JavaVM vm, void *reserved)
{
JniHelper:: * setJavaVM(vm); ** //这里报错return JNI_VERSION_1_4;
}
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h)
{
if (!CCDirector:: ** sharedDirector()->getOpenGLView() ** )//这里报错
{
CCEGLView view = CCEGLView:: * sharedOpenGLView() ** ;//这里报错
view->setFrameSize(w, h);*//这里报错* *AppDelegate* ** *pAppDelegate = new AppDelegate(); CCApplication:: ** *sharedApplication()->run()* ** ;//这里报错 } /* else { ccDrawInit(); ccGLInvalidateStateCache(); CCShaderCache::sharedShaderCache()->reloadDefaultShaders(); CCTextureCache::reloadAllTextures(); CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL); CCDirector::sharedDirector()->setGLDefaultValues(); } */
}
}
错误信息:E:/android-ndk-r8e-windows-x86_64/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/Scene/Menu.o: in function Menu::update(float):jni/../../Classes/Scene/Menu.cpp:119: error: undefined reference to 'AboutScene::scene()'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1