build error


#1

I use cocos2dx-2.1.2 create a lua project,after I finish my code work I want to create an android project for this project.
When I compile the android project,the error comes out.
jni/hellocpp/main.cpp: In function 'void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv*, jobject, jint, jint)': jni/hellocpp/main.cpp:23:10: error: 'CCDirector' has not been declared jni/hellocpp/main.cpp:25:9: error: 'CCEGLView' was not declared in this scope jni/hellocpp/main.cpp:25:20: error: 'view' was not declared in this scope jni/hellocpp/main.cpp:25:27: error: 'CCEGLView' is not a class or namespace jni/hellocpp/main.cpp:33:20: error: 'ccDrawInit' was not declared in this scope jni/hellocpp/main.cpp:34:34: error: 'ccGLInvalidateStateCache' was not declared in this scope jni/hellocpp/main.cpp:36:9: error: 'CCShaderCache' has not been declared jni/hellocpp/main.cpp:37:9: error: 'CCTextureCache' has not been declared jni/hellocpp/main.cpp:38:9: error: 'CCNotificationCenter' has not been declared jni/hellocpp/main.cpp:38:76: error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope jni/hellocpp/main.cpp:39:9: error: 'CCDirector' has not been declared make: *** [obj/local/armeabi/objs/game_shared/hellocpp/main.o] Error 1

I check the path in Andoid.mk, there is nothing wrong.Could anyone help me.


#2

This should not be a big problem , I just don’t know how to solve. I will appreciate of your help.


#3

I have solve this problem by add line ‘#include “cocos2d.h”’ to main.cpp. But another problem occurred:
AppDelegate.cpp:6:32: fatal error: Lua_extensions_CCB.h: No such file or directory

Seems some module not imported, anyone could tell me which the module is.


#4

This problem is solved.


#5

Similar issue. How did you resolve this?


#6

Which version did you use?


#7

@Happy wrote:

Similar issue. How did you resolve this?

I import the needed module in Android.mk file,then the problem solved.