编译是报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"即可。

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

时间: 2024-10-06 15:24:51

编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope的相关文章

解决Cygwin编译cocos2dx 遇到的 error: &#39;UINT64_C&#39; was not declared in this scope 问题

环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2dx lib库以后,讨厌的红x消失,下来就是在cygwin里面预编译得到xxx.so文件了,但是问题来了,报错!!! jni/../../Classes/GameLayer.cpp:227:46: error: 'UINT64_C' was not declared in this scope 怎么

【Cocos2d-x】编译Android工程时提示error: &#39;GL_LINE_SMOOTH&#39; was not declared in this scope

在Cocos2d-x项目中用到了OpenGL,使用GL_LINE_SMOOTH开启线条抗锯齿.代码如下: ccDrawColor4B(50, 26, 12, 255); // 设置线宽 glLineWidth(2.0f); // 启用线段反锯齿 glEnable(GL_LINE_SMOOTH); // 画第一条线 ccDrawLine(startPoint1,endPoint); // 画第二条线 ccDrawLine(startPoint2,endPoint); // 关闭线段反锯齿 glDi

android stdio 编译项目报Error:Failed to find target with hash string &#39;android-24

android stdio 编译项目报Error:Failed to find target with hash string 'android-24 查看已有的SDK 设置项目的sdk为 25 android { compileSdkVersion 25 buildToolsVersion "25.0.0" defaultConfig { applicationId "com.accessibility" minSdkVersion 14 targetSdkVer

mips交叉编译 error: &#39;PTHREAD_MUTEX_ERRORCHECK_NP&#39; was not declared in this scope

在mips交叉编译时,设置互斥锁时,报以下错误,始终编译不过去. error: 'PTHREAD_MUTEX_ERRORCHECK_NP' was not declared in this scope 各种百度,相关信息一条也没有找到,实在没办法了,各种尝试. 打开linux平台和mips平台的pthread.h一对比才恍然大悟,原来在mips平台上,互斥锁类型使用的是: #define PTHREAD_MUTEX_NORMAL 0 #define PTHREAD_MUTEX_DEFAULT 0

qt-everywhere-opensource-src-4.8.1 出错:error: &#39;IPV6_MULTICAST_HOPS&#39; was not declared in this scope

在编译:qt-everywhere-opensource-src-4.8.1出现如下错误: /opt/buildroot-2011.11/arm920t/usr/bin/arm-linux-g++ -c -include .pch/release-shared-emb-arm/QtNetwork -pipe -fno-exceptions -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC

In function &#39;int av_clipl_int32_c(int64_t)&#39;: error: &#39;UINT64_C&#39; was not declared in this scope

cygwin下使用ndk编译jni时遇到的错误: /ffmpeg/include/libavutil/common.h: In function 'int av_clipl_int32_c(int64_t)': /ffmpeg/include/libavutil/common.h:178:47: error: 'UINT64_C' was not declared in this scope 解决方法: 修改头文件 /ffmpeg/include/libavutil/common.h 添加如下代

error: &#39;LOGE&#39; was not declared in this scope

移植了下HAL,发现编译出现如下错误 error: 'LOGE' was not declared in this scope 比较了一下android4.1的 system/core/include/cutils/log.h和android4.0的对应文件, 发现在4.1当中已经将所有的LOG宏前面加了一个字母A .所以出现上述编译错误. 修改HAL层源码:将LOGE   LOGD等等全部加个A 方法: `grep  LOG  -rl  .` 附上一个linux中的字符串查找替换用法: Lin

error: `cout&#39; was not declared in this scope

原因:C++ 1998 要求cout and endl被调用使用'std::cout'和'std::endl'格式,或using namespace std; 修改后:#include<iostream> std::cout << "Hello World!" << std::endl; 或者 #include<iostream>using namespace std; error: `cout' was not declared in

【STL源码剖析】--error: ‘power’ was not declared in this scope

#include <numeric> #include <vector> #include <iterator> #include <iostream> using namespace std; int main(int argc, char **argv) { int iArray[5] = {1, 2, 3, 4, 5}; vector<int> iVect(iArray, iArray+5); cout << accumulat