求助:clang++报错!

按照开发文档进行环境部署:

cocos2d-x -> 开发前期和基础技术->开发环境->环境搭建v3.x->windows->在windows7上搭建cocos2d-x Android 开发环境

进行到

生成Android项目文件

在新建项目test项目中,执行proj.android下的build_native.py脚本进行编译。
的时候报错了。。。。

以下是控制台输出信息:

E:\mywork\cocos\cocos2d-x-3.2rc0\cocos2d-x-3.2rc0\tools\cocos2d-console\bin~\De
sktop\test\proj.android>python build_native.py
The Selected NDK toolchain version was 4.8 !
Android NDK: WARNING:jni/…/…/cocos2d/cocos/./Android.mk:cocos2dx_static: LOCAL
_LDLIBS is always ignored for static libraries
Android NDK: WARNING:jni/…/…/cocos2d/cocos/platform/android/Android.mk:cocos2d
xandroid_static: LOCAL_LDLIBS is always ignored for static libraries
make.exe: Entering directory `E:/mywork/cocos/cocos2d-x-3.2rc0/cocos2d-x-3.2rc0/
tools/cocos2d-console/bin/~/Desktop/test/proj.android’
Compile++ thumb: cocos2dcpp_shared <= main.cpp
Compile++ thumb: cocos2dcpp_shared <= AppDelegate.cpp
Compile++ thumb: cocos2dcpp_shared <= HelloWorldScene.cpp
Assertion failed: begin() + idx < end(), file /s/ndk-toolchain/src/llvm-3.4/llvm
/include/llvm/ADT/SmallVector.h, line 140

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
Compile++ thumb: cocos2dx_static <= cocos2d.cpp
Assertion failed: begin() + idx < end(), file /s/ndk-toolchain/src/llvm-3.4/llvm
/include/llvm/ADT/SmallVector.h, line 140

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
Assertion failed: begin() + idx < end(), file /s/ndk-toolchain/src/llvm-3.4/llvm
/include/llvm/ADT/SmallVector.h, line 140

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
Assertion failed: begin() + idx < end(), file /s/ndk-toolchain/src/llvm-3.4/llvm
/include/llvm/ADT/SmallVector.h, line 140

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
make.exe: ***
elegate.o] Error 255
make.exe: *** Waiting for unfinished jobs…
make.exe: ***
oWorldScene.o] Error 255
make.exe: *** Error 255

make.exe: *** E
rror 255
make.exe: Leaving directory `E:/mywork/cocos/cocos2d-x-3.2rc0/cocos2d-x-3.2rc0/t
ools/cocos2d-console/bin/~/Desktop/test/proj.android’
Traceback (most recent call last):
File “build_native.py”, line 159, in
build(opts.ndk_build_param,opts.android_platform,opts.build_mode)
File “build_native.py”, line 146, in build
do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,and
roid_platform,build_mode)
File “build_native.py”, line 82, in do_build
raise Exception(“Build dynamic library for project " + app_android_root +
" ] fails!”)
Exception: Build dynamic library for project E:\mywork\cocos\cocos2d-x-3.2rc0
cocos2d-x-3.2rc0\tools\cocos2d-console\bin~\Desktop\test\proj.android ] fails!

E:\mywork\cocos\cocos2d-x-3.2rc0\cocos2d-x-3.2rc0\tools\cocos2d-console\bin~\De
sktop\test\proj.android>

经检查,发现下载的 android-ndk32-r10-windows-x86中,有以下四个文件含有lang

android-ndk32-r10-windows-x86\android-ndk-r10\toolchains\llvm-3.3\prebuilt\windows\bin\clang.exe
android-ndk32-r10-windows-x86\android-ndk-r10\toolchains\llvm-3.3\prebuilt\windows\bin\clang++.exe
android-ndk32-r10-windows-x86\android-ndk-r10\toolchains\llvm-3.4\prebuilt\windows\bin\clang.exe
android-ndk32-r10-windows-x86\android-ndk-r10\toolchains\llvm-3.4\prebuilt\windows\bin\clang++.exe

点击运行发现,llvm-3.4的两个文件都会报这种错

Assertion failed: begin() + idx < end(), file /s/ndk-toolchain/src/llvm-3.4/llvm
/include/llvm/ADT/SmallVector.h, line 140

网上目前还没找到有关这个问题的原因

尝试将llvm-3.3的两个问题覆盖到llvm-3.4中,然后执行python build_native.py,虽不会弹出错误框,却会报编译错误

这个不是IDE的问题,请切换回ndk r9d版本进行编译。ndk r10上目前编译cocos2d-x有问题,今天引擎团队正在修复

下载了ndk r9d版本,还是有这个问题。。。。

llvm-3.4里面的clang运行程序运行会出错。。。

有没有办法修改py文件,使得不用llvm-3.4下面的clang,而用llvm-3.3下面的clang,因为3.3下面的不会出错

目前尝试研究得到的非最佳方案:

  1. 我下载了一个ndk r9,它的clang没有这些问题,因为没有llvm-3.4
  2. 但是编译会出现 Android NDK: Invalid APP_STL value: c++_static 的错误,经网上搜索得到解决的帖子:http://blog.csdn.net/wk3368/article/details/37829017
  3. 根据帖子描述的2号解决方案,可以成功地生成andrord项目,用的是ndk r9
  4. 我把环境切换回ndk r9d, 然后再用帖子的2号解决方案,也可以成功地生成andrord项目(这说明2号解决方案不会用到llvm-3.4,所以不会报clang craush错误)

那估计是了我用的r10一样卡在这儿,是要等下次引擎更新的时候修复对 r10的支持么?

这些真是令人头疼一有东西更新就会出现支持问题

那估计是了我用的r10一样卡在这儿,是要等下次引擎更新的时候修复对 r10的支持么?

这些真是令人头疼一有东西更新就会出现支持问题

:8::8::8::8::8::8::8::8::8:

完美解决 困扰了很久了~~~

没想clang也会有问题!

怎么解决的啊?