2015-08-22 51 views
0

我剛剛創建了一個新的項目,cocos2d的-X 2.2.6和NDK r9d,並試圖構建它,並收到以下錯誤:的cocos2d-x NDK本地構建失敗 - 不能執行二進制文件

$ /cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android/build_native.sh 
NDK_ROOT = C:\Android\ndk\android-ndk-r9d 
COCOS2DX_ROOT = /cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android/../../.. 
APP_ROOT = /cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android/.. 
APP_ANDROID_ROOT = /cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android 
Using prebuilt externals 
make: Entering directory '/cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android' 
Android NDK: WARNING:/cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android/../../../cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries 
[armeabi] Compile++ thumb: cocos2dcpp_shared <= main.cpp 
/bin/sh: /cygdrive/c/Android/ndk/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++: cannot execute binary file: Exec format error 
/cygdrive/c/Android/ndk/android-ndk-r9d/build/core/build-binary.mk:393: recipe for target 'obj/local/armeabi/objs/cocos2dcpp_shared/hellocpp/main.o' failed 
make: *** [obj/local/armeabi/objs/cocos2dcpp_shared/hellocpp/main.o] Error 126 
make: Leaving directory '/cygdrive/c/cocos2d-x/cocos2d-x-2.2.6/projects/DSTest/proj.android' 

我已經搜索了上述問題,並重新安裝了ndk和cocos2d-x,但尚未解決問題。

回答

0

儘量把所有依賴於C:驅動器,還可以使用最新版本cocos2dx,因爲有cocos2dx 2之間有很多過時的代碼.....和cocos2dx 3 ....

+0

一切都在C盤上。它曾用於構建,但我不確定發生了什麼變化,沒有任何一個cocos2dx 2項目會建立,這就是爲什麼我創建了一個新的測試項目來查看它是否也是如此。我的長期計劃是將項目移至cocos2dx 3.但暫時我只是試圖讓項目再次構建。謝謝 – user5255727

0

只是嘗試重新安裝NDK和cocos2d-x,它現在可以工作

相關問題