cocos2d-x3.2 执行build_native.py 显示 couldn't find the gcc toolchains

cocos2d-x3.2 执行build_native.py 显示 couldn't find the gcc toolchains,第1张

概述啊  !!!!弄了一个小时,连续报错,姐姐我都快崩溃了。 无奈打开build_native.py,看看里面究竟写的啥。这是那段报错的地方。 def select_toolchain_version():     '''Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select g

啊 !!!!弄了一个小时,连续报错,姐姐我都快崩溃了。 无奈打开build_native.py,看看里面究竟写的啥。这是那段报错的地方。

def select_toolchain_version():
'''Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when
using ndk-r8e. But gcc4.7 is removed in ndk-r9,so we should determine whether gcc4.7 exist.
Conclution:
ndk-r8e -> use gcc4.7
ndk-r9 -> use gcc4.8
'''

ndk_root = check_environment_variables()
if os.path.isdir(os.path.join(ndk_root,"toolchains/arm-linux-androIDeabi-4.8")):
os.environ['NDK_TOolCHAIN_VERSION'] = '4.8'
print "The Selected NDK toolchain version was 4.8 !"
elif os.path.isdir(os.path.join(ndk_root,"toolchains/arm-linux-androIDeabi-4.7")):
os.environ['NDK_TOolCHAIN_VERSION'] = '4.7'
print "The Selected NDK toolchain version was 4.7 !"
else:
print "Couldn't find the gcc toolchain."

exit(1)


网上可能错误的解答.cocos2d-x3.2 只支持ndk r9. 因为ndkr10没有toolchains/arm-linux-androIDeabi-4.8"。其实ndkr10 到源文件看,什么都有,品类齐全。

网上正解:ndk_root不能有空格,是的。但是我检查了我的ndk_root没有空格啊。怎么办呢。。。焦急如焚。后来我想无论如何这个问题肯定是,python的os.path.isdir(os.path.join这两句无法读取我的NDK_ROOT。而我NDK解包的时候自动在文件夹中生成了androID-ndk-r10c这个文件夹,是不是'-'.也不能放在NDK_ROOT中。我将NDK_ROOT从F:\developer\software\androIDNDK\androID-ndk-r10c改为F:\developer\software\androIDNDK\r10c。哈哈哈 系统显示The Selected NDK toolchain version was 4.8 !。。。。。。坑爹啊。。。。

不过事情到这里也不一定结束了。坑爹的NDK后面还会有其他错,不过这个不会有了。。。。。连Google都说尽量别用NDK。

总结

以上是内存溢出为你收集整理的cocos2d-x3.2 执行build_native.py 显示 couldn't find the gcc toolchains全部内容,希望文章能够帮你解决cocos2d-x3.2 执行build_native.py 显示 couldn't find the gcc toolchains所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1024764.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存