Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cocos2d-x3.2 executes build_native.py display couldn't find the gcc toolchains what to do

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to implement build_native.py display couldn't find the gcc toolchains in Cocos2d-x3.2, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Solution:

1. Change the ndk folder name android-ndk-r10c to androidndkr10c as long as there is no horizontal line

two。 Modify the NDK_ROOT path in the environment variable to remove the original horizontal line

That is, from D:\ cocos\ android-ndk-r9d to D:\ cocos\ androidndkr9d

The analysis is as follows:

Open build_native.py with EditPlus

Def select_toolchain_version ():

Because ndk-r8e uses gcc4.6 as default. Gcc4.6 doesn't support cantilever 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)

The answer that may be wrong on the Internet. Cocos2d-x3.2 only supports ndk R9. Because ndkr10 does not have toolchains/arm-linux-androideabi-4.8. In fact, ndkr10 to the source file, there is everything, a full range of categories.

Ndk_root can't have spaces, yes. But I checked my ndk_root. There are no spaces. What are we going to do? no, no, no. I was burning with anxiety. Later I thought that the problem anyway was that python's os.path.isdir (os.path.join) could not read my NDK_ROOT. When I unpack NDK, I automatically generate the android-ndk-r10c folder in the folder, isn't it? You can't put it in NDK_ROOT either. I changed NDK_ROOT from F:\ developer\ software\ androidNDK\ android-ndk-r10c to F:\ developer\ software\ androidNDK\ r10c. Ha, the system shows The Selected NDK toolchain version was 4.8, Compilation passed ~

On the implementation of Cocos2d-x3.2 build_native.py display couldn't find the gcc toolchains how to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report