Error fatal error: CCApplication.h: No such file or directory


#1

I am trying to create a new cocos2dx project in windows 7 64 bit
cocos2dx version : cocos2d-2.1rc0-x-2.1.3
ADT Bundle : adt-bundle-windows-x86_64-20130514
NDK : android-ndk-r8e-windows-x86_64
Path variables:
NDK_ROOT=c:;
Path: ……other windows stuffs;c:java“;c:;
When i execute create-android-project.bat, no error is shown. the project is created fine.
But when i import it to eclipse it shows error in AppDelegate.h file.
i have include the following entries in properties~~>paths and symbols~~>includes
C:9\arch-arm\usr\include and
C:2dx\cocos2dx\include
i have also linked my project’s class folder in source tab. But when i try to run the application as an android project, the code compiles and shows the following
* Build of configuration Default for project moleitx*
bash ./build_native.sh NDK_DEBUG=1 V=1 all
cygwin warning:
MS-DOS style path detected: C:2dx\moleitx\proj.android
Preferred POSIX equivalent is: /cygdrive/c/android/cocos2dx/moleitx/proj.android
CYGWIN environment variable option “nodosfilewarning” turns off this warning.
Consult the user’s guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
NDK_ROOT = c:COCOS2DX_ROOT = C:/cocos2dx/moleitx/proj.android/…/…
APP_ROOT = C:/cocos2dx/moleitx/proj.android/…
APP_ANDROID_ROOT = C:/cocos2dx/moleitx/proj.android
Using prebuilt externals
make: Entering directory `/cygdrive/c/android/cocos2dx/moleitx/proj.android’
/cygdrive/c/android/NDK/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-9 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Android NDK: WARNING: Ignoring unknown import directory: C
Android NDK: WARNING: Ignoring unknown import directory: C
rm
f ./libs/armeabi/lib**.so ./libs/armeabi-v7a/lib**.so ./libs/mips/lib**.so ./libs/x86/lib**.so
rm f ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/mips/gdbserver ./libs/x86/gdbserver
rm
f ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/mips/gdb.setup ./libs/x86/gdb.setup
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
install ~~p /cygdrive/c/android/NDK/prebuilt/android-arm/gdbserver/gdbserver ./libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
echo “set solib-search-path ./obj/local/armeabi” > ./libs/armeabi/gdb.setup
echo “directory C:/android/NDK/platforms/android-9/arch-arm/usr/include /cocos2dx/moleitx/proj.android/…/…/external/Box2D/… C:/android/NDK/sources/cxx-stl/gnu-libstdc**/4.6/include C:/android/NDK/sources/cxx-stl/gnu-libstdc**/4.6/libs/armeabi/include /cocos2dx/moleitx/proj.android/…/…/external/chipmunk/include/chipmunk /cocos2dx/moleitx/proj.android/…/…/cocos2dx /cocos2dx/moleitx/proj.android/…/…/cocos2dx/include /cocos2dx/moleitx/proj.android/…/…/cocos2dx/kazmath/include /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/android /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libpng/include /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libjpeg/include /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libtiff/include /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libwebp/include C:/android/NDK/sources/android/cpufeatures /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libcurl /cocos2dx/moleitx/proj.android/…/…/CocosDenshion/android/…/include /cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libcurl/include /cocos2dx/moleitx/proj.android/…/…/extensions /cocos2dx/moleitx/proj.android/…/…/CocosDenshion/android/…/…/cocos2dx /cocos2dx/moleitx/proj.android/…/…/CocosDenshion/android/…/…/cocos2dx/include /cocos2dx/moleitx/proj.android/…/…/CocosDenshion/android/…/…/cocos2dx/kazmath/include /cocos2dx/moleitx/proj.android/…/…/CocosDenshion/android/…/…/cocos2dx/platform/android jni/…/…/Classes /cocos2dx/moleitx/proj.android/…/…/extensions/CCBReader /cocos2dx/moleitx/proj.android/…/…/extensions/GUI/CCControlExtension /cocos2dx/moleitx/proj.android/…/…/extensions/GUI/CCScrollView /cocos2dx/moleitx/proj.android/…/…/extensions/network /cocos2dx/moleitx/proj.android/…/…/extensions/LocalStorage” >> ./libs/armeabi/gdb.setup
Compile*+ thumb : game_shared <= main.cpp
Cygdrive/c/android/NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g*+~~MMD MPMF ./obj/local/armeabi/objs-debug/game_shared/hellocpp/main.o.d.org fpicffunction-sections funwind-tablesfstack-protector no-canonical-prefixesmarch=armv5te mtune=xscalemsoft-float fno-exceptionsfno-rtti mthumbOs gDNDEBUG fomit-frame-pointerfno-strict-aliasing finline-limit=64O0 UNDEBUGmarm fno-omit-frame-pointerIjni/…/…/Classes IC:/android/NDK/sources/cxx-stl/gnu-libstdc++/4.6/includeIC:/android/NDK/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include I\android/cocos2dx/moleitx/proj.android/…/…/cocos2dxI\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/include I\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/kazmath/includeI\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/android I\android/cocos2dx/moleitx/proj.android/…/…/CocosDenshion/android/…/includeI\android/cocos2dx/moleitx/proj.android/…/…/extensions I\android/cocos2dx/moleitx/proj.android/…/…/extensions/CCBReaderI\android/cocos2dx/moleitx/proj.android/…/…/extensions/GUI/CCControlExtension I\android/cocos2dx/moleitx/proj.android/…/…/extensions/GUI/CCScrollViewI\android/cocos2dx/moleitx/proj.android/…/…/extensions/network I\android/cocos2dx/moleitx/proj.android/…/…/extensions/LocalStorageI\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libpng/include I\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libjpeg/includeI\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libtiff/include I\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libwebp/includeI\android/cocos2dx/moleitx/proj.android/…/…/cocos2dx/platform/third_party/android/prebuilt/libcurl/include ~~I\android/cocos2dx/moleitx/proj.android/…/…/external/Box2D/…~~I\android/cocos2dx/moleitx/proj.android/…/…/external/chipmunk/include/chipmunk IC:/android/NDK/sources/android/cpufeaturesIjni DANDROIDWno-psabi DUSE_FILE32APIWno-psabi DCC_ENABLE_CHIPMUNK_INTEGRATION=1Wa,—noexecstack frttiDCOCOS2D_DEBUG=1 IC:/android/NDK/platforms/android-9/arch-arm/usr/includec jni/hellocpp/main.cpp ~~o ./obj/local/armeabi/objs-debug/game_shared/hellocpp/main.o && ./obj/convert-dependencies.sh ./obj/local/armeabi/objs-debug/game_shared/hellocpp/main.o.d
In file included from jni/hellocpp/main.cpp:1:0:
jni/…/…/Classes/AppDelegate.h:4:27: fatal error: CCApplication.h: No such file or directory
compilation terminated.
/cygdrive/c/android/NDK/build/core/build-binary.mk:272: recipe for target `obj/local/armeabi/objs-debug/game_shared/hellocpp/main.o’ failed
make: Leaving directory `/cygdrive/c/android/cocos2dx/moleitx/proj.android’
make: * Error 1
* Build Finished*

The error is shown in AppDelegate.h is on
#include "CCApplication.h"
and shows error
~~ fatal error: CCApplication.h: No such file or directory

  • Unresolved inclusion:”CCApplication.h"

Also almost every include with .h extension has “unresolved” error . ie, cocos2d.h,SimpleAudioEngine.h etc
if have tried including folders like cocos2dx\platform\android etc… But didnt work… Some body please figure out what is the problem…


#2

You should add this directories to the include path in Eclipse (Right-click your project > properties> C/C++ General > Paths and Symbols> Includes ~~> GNU C++) :
<pre>
PATH_TO_COCOS/cocos2dx/include
PATH_TO_NDK/platforms/android-9/arch-arm/usr/include
</pre>
So if I see correctly in your log it would be like this :
<pre>
C:2dx\cocos2dx\include
C:~~9\arch-arm\usr\include


#3

But the problem is still there same error no change… between the problems shown are

Description Resource    Path    Location    Type
fatal error: CCApplication.h: No such file or directory AppDelegate.h   /moleitx/Classes    line 4  C/C++ Problem
make: *** [obj/local/armeabi/objs-debug/game_shared/hellocpp/main.o] Error 1    moleitx         C/C++ Problem
recipe for target `obj/local/armeabi/objs-debug/game_shared/hellocpp/main.o' failed moleitx     line 272, external location: C:\android\NDK\build\core\build-binary.mk  C/C++ Problem

#4

@Pawel Lopusinski:
problem solved… i moved the project to

C:\android\cocos2dx\samples\Cpp

and then add the following in includes tab as given a sample project

assembly

${ProjDirPath}/jni
${NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/lib/gcc/arm-linux-androideabi/4.4.3/include  not found
${ProjDirPath}/../../../../cocos2dx
${ProjDirPath}/../../../../cocos2dx/include
${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include
${NDK_ROOT}/sources/cxx-stl/system/include
${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include
${NDK_ROOT}/platforms/android-9/arch-arm/usr/include

gnu c

${ProjDirPath}/jni
${ProjDirPath}/../../../../cocos2dx/include
${NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/lib/gcc/arm-linux-androideabi/4.4.3/include   not found
${ProjDirPath}/../../../../cocos2dx
${NDK_ROOT}/sources/cxx-stl/stlport/stlport
${NDK_ROOT}/platforms/android-9/arch-arm/usr/include

gnu c++

${NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/lib/gcc/arm-linux-androideabi/4.4.3/include    not found
${ProjDirPath}/../../../../cocos2dx/include
${ProjDirPath}/jni
${ProjDirPath}/../../../../cocos2dx
${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include
${NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include
${NDK_ROOT}/sources/cxx-stl/stlport/stlport
${NDK_ROOT}/platforms/android-9/arch-arm/usr/include

the error had gone… but when i run the program, only black screen is shown. nothing is displayed.
dont knw why… but thanks for the tip