Cocos 3.0 Beta 2 android build problems. Missing header file

Cocos 3.0 Beta 2 android build problems. Missing header file
0

#1

Hello! I just updated our project to a new version of cocos2d-x. Code is working fine on desktop, but I have compiler error while trying to build it for android. At first I tried to compile project using Eclipse as I did before, but project setup is not updated for the new version. So I decided to use python script (build_native.py). All the paths are correct so compilers starts to compile libs. Files that are created are libcoco2d.a, libcocosdenshion.a and libspine.a. Python script gives me an error message:

In file included from \proj.andr
oid\../cocos2d/cocos/2d/platform/desktop/CCEGLView.cpp:26:0:
proj.android\../cocos2d/cocos/2
d/platform/desktop/CCEGLView.h:31:19: fatal error: glfw3.h: No such file or dire
ctory
 #include "glfw3.h"

I wonder why script tries to include header from dektop folder? Is that meant to be so?

Here is my android makefile:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/PureCamera.cpp \
				   ../../Classes/FXNode.cpp \
				   ../../Classes/EnemyFactory.cpp \
				   ../../Classes/FXFactory.cpp \
				   ../../Classes/ProjectileFactory.cpp \
				   ../../Classes/ScriptLoader.cpp \
				   ../../Classes/Helpers.cpp \
				   ../../Classes/PureAlign.cpp \
				   ../../Classes/EnemyManager.cpp \
				   ../../Classes/EventSolver.cpp \
				   ../../Classes/FXManager.cpp \
				   ../../Classes/GlobalManager.cpp \
				   ../../Classes/LevelManager.cpp \
				   ../../Classes/PlayerManager.cpp \
				   ../../Classes/ProjectileManager.cpp \
				   ../../Classes/SpecialManager.cpp \
				   ../../Classes/GameScene.cpp \
				   ../../Classes/LoadingScene.cpp \
				   ../../Classes/MainMenuScene.cpp \
                   ../../Classes/StartUpScene.cpp \
				   ../../Classes/Creature.cpp \
				   ../../Classes/Player.cpp \
				   ../../Classes/Projectile.cpp \
				   ../../Classes/Enemy.cpp \
				   ../../Classes/ChapterScene.cpp \
				   ../../Classes/GameOverScene.cpp \
				   ../../Classes/LevelScene.cpp \
				   ../../Classes/HeroLayer.cpp \
				   ../../Classes/RuneLayer.cpp \
				   ../../Classes/ShopLayer.cpp \
				   ../../Classes/UpgradeScene.cpp \
				   ../../Classes/PauseLayer.cpp \
				   ../../Classes/ScrollTextManager.cpp \
				   ../../Classes/Rune.cpp \
				   ../../Classes/RuneFactory.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES += spine_static


include $(BUILD_SHARED_LIBRARY)

$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)
$(call import-module,editor-support/spine)

[glfw3.h] No such file or directory...CCEGLView.h 3.0beta2
#2

Okay! I resolved the problem. It seems that project creator script is doing some buggy things in cocos2d_static android.mk. There were platform/desktop define in LOCALSRCFILES and I checked the original cocos makefile and there was everything okay. I replaced generated one with the original and everything works fine.


#3

hi samithegreat, Now I have the same problem,too. And acorrding your way, I replace xxxx\cocos2d\cocos\2d\Android.mk with original “cocos2d-x-3.0beta2\cocos\2d\Android.mk” file.But the problem still exist. Can you give me the detail how to resolve it?


#4

I resolved it, although I don’t know what made the problem. I just create a new project by the original cocos which release form the download cocos2d pack. And the new project is OK. Maybe I changed something in my old cocos2d but I haven’t noticed it.