• 编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope


    Compile++ thumb  : game_shared <= main.cpp 
    jni/hellocpp/main.cpp: In function 'void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv*, jobject, jint, jint)': 
    jni/hellocpp/main.cpp:25:10: error: 'CCDirector' has not been declared 
    jni/hellocpp/main.cpp:27:9: error: 'CCEGLView' was not declared in this scope 
    jni/hellocpp/main.cpp:27:20: error: 'view' was not declared in this scope 
    jni/hellocpp/main.cpp:27:27: error: 'CCEGLView' is not a class or namespace 
    jni/hellocpp/main.cpp:35:20: error: 'ccDrawInit' was not declared in this scope 
    jni/hellocpp/main.cpp:36:34: error: 'ccGLInvalidateStateCache' was not declared in this scope 
    jni/hellocpp/main.cpp:38:9: error: 'CCShaderCache' has not been declared 
    jni/hellocpp/main.cpp:39:9: error: 'CCTextureCache' has not been declared 
    jni/hellocpp/main.cpp:40:9: error: 'CCNotificationCenter' has not been declared 
    jni/hellocpp/main.cpp:40:76: error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope 
    jni/hellocpp/main.cpp:41:9: error: 'CCDirector' has not been declared 
    /cygdrive/e/android/NDK/android-ndk-r8e-windows-x86/android-ndk-r8e/build/core/build-binary.mk:272: recipe for target `obj/local/armeabi/objs/game_shared/hellocpp/main.o' failed 
    make: *** [obj/local/armeabi/objs/game_shared/hellocpp/main.o] Error 1 
    make: 离开目录“/cygdrive/d/MyCoder/trunk/cocos2d-x/cocos2d-2.1rc0-x-2.1.2-hotfix/cocos2d-2.1rc0-x-2.1.2/testpppp/proj.android” 

    编译时,由于在main.cpp中删除了 #include "HelloWorldScene.h",导致没有包含#include "cocos2d.h"而出上述的错误。

    则直接在main.cpp中加入#include "cocos2d.h"即可。

  • 相关阅读:
    iOS 数字滚动 类似于老
    iOS 实现转盘的效果
    iOS 摇一摇的功能
    APP上架证书无效:解决
    iOS--UIAlertView与UIAlertController和UIAlertAction之间的事儿
    ios 获取字符串所需要占用的label的高度
    适配----Autolayout
    OC中 block 的用法
    微信小程序如何播放腾讯视频?
    IOS-UICollectionView
  • 原文地址:https://www.cnblogs.com/DswCnblog/p/4057879.html
Copyright © 2020-2023  润新知