During Ascend Project Development, What Do I Do If Error "cannot execute binary file: Exec format error" Is Reported After the Toolchain in Compilation Configuration Is Changed?

Symptom

During development of an Ascend project, the toolchain in the compilation configuration is changed and the compilation architecture is switched. When the project is compiled again and runs in the environment of the corresponding architecture, the following error message is displayed:

cannot execute binary file: Exec format error

Possible Cause

Without any changes to the project content, the compilation configuration is switched, the compilation architecture is changed, and the Build CMake Project is used for incremental compilation. As a result, the final compilation result is not generated again.

Solution

After the project compilation configuration is switched, click Rebuild CMake Project to perform full compilation, or click Clean CMake Project to clear the compilation result and then click Build CMake Project to perform compilation again.