Android NDK: ERROR:/cygdrive/e/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android/../../cocos2dx/platform/third_party/android/prebuilt/libjpeg/Android.mk:cocos_jpeg_static: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /cygdrive/e/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android/../../cocos2dx/platform/third_party/android/prebuilt/libjpeg/libs/armeabi/libjpeg.a exists or that its path is correct
make: 进入目录“/cygdrive/e/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android”
/cygdrive/e/android/android-ndk-windows/android-ndk-r9/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting 。 停止。
make: 离开目录“/cygdrive/e/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android”
这个是少文件。不过我从官网下的cocos2d-2.1rc0-x-2.1.3。然后build-win32.bat安装。都很顺利。最后发现时是 cocos2dxplatform hird_party 下少各个平台的第三方库文件。发现 CocosDenshion hird_party 也是少库文件。不知道为什么没解压出来。不过cocos2d-2.1rc0-x-2.1.3的压缩文件中是有这些库文件的。也不管了,解压出来覆盖过去就没有问题了。
3.编译 CCCommon.cpp 文件时报错。
Compile++ thumb : cocos2dx_static <= CCCommon.cpp
E:/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android/../../cocos2dx/platform/android/CCCommon.cpp: In function 'void cocos2d::CCLog(char const*, ...)':
E:/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android/../../cocos2dx/platform/android/CCCommon.cpp:44:72: error: format not a string literal and no format arguments [-Werror=format-security]
E:/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android/../../cocos2dx/platform/android/CCCommon.cpp: In function 'void cocos2d::CCLuaLog(char const*)':
E:/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android/../../cocos2dx/platform/android/CCCommon.cpp:54:77: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus.exe: some warnings being treated as errors
/cygdrive/e/android/android-ndk-windows/android-ndk-r9/build/core/build-binary.mk:348: recipe for target `obj/local/armeabi/objs/cocos2dx_static/platform/android/CCCommon.o' failed
make: *** [obj/local/armeabi/objs/cocos2dx_static/platform/android/CCCommon.o] Error 1
make: 离开目录“/cygdrive/e/cocos2d-x/code/cocos2d-2.1rc0-x-2.1.3/HelloTest1/proj.android”
google了下 国外论坛有人也出现了这样的问题。
因为我的ndk是r9,有人建议换回r8,我没试。最后发现有人这样解决。
修改你自己项目 proj.androidjniApplication.mk 文件,在最后加上
APP_CPPFLAGS += -Wno-error=format-security 就可以了。