HarmonyOS 鸿蒙Next:Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_

发布于 1周前 作者 ionicwang 来自 鸿蒙OS

HarmonyOS 鸿蒙Next:Tell CMake where to find the compiler by setting either the environment variable “CXX” or the CMake cache entry CMAKE_ Tell CMake where to find the compiler by setting either the environment variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

Detail: Please check the message from tools.

正常运行,突然报出这个,应该如何修复,已经重启电脑多次,无效。


更多关于HarmonyOS 鸿蒙Next:Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

4 回复

已解决,360把关键文件删掉了

更多关于HarmonyOS 鸿蒙Next:Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


您好,合作厂商问题请走对应渠道提问

在HarmonyOS鸿蒙Next中,如果你需要告诉CMake编译器的位置,可以通过设置环境变量CXX或CMake缓存条目CMAKE_CXX_COMPILER来实现。具体操作如下:

  1. 设置环境变量CXX: 在终端中执行以下命令,将CXX环境变量设置为编译器的路径:

    export CXX=/path/to/your/compiler

    其中/path/to/your/compiler应替换为实际的编译器路径。

  2. 设置CMake缓存条目CMAKE_CXX_COMPILER: 在CMake命令行中,使用-D选项直接设置CMAKE_CXX_COMPILER

    cmake -DCMAKE_CXX_COMPILER=/path/to/your/compiler ..

    同样,/path/to/your/compiler应替换为实际的编译器路径。

这两种方法都可以让CMake找到并使用指定的编译器进行项目构建。

在HarmonyOS鸿蒙Next中,若需指定编译器路径,可通过以下两种方式实现:

  1. 设置环境变量:在终端中执行 export CXX=/path/to/your/compiler,将 CXX 变量指向你的编译器路径。

  2. 设置CMake缓存:在CMake配置时,使用 -DCMAKE_CXX_COMPILER=/path/to/your/compiler 参数,直接指定编译器路径。

这两种方法均可确保CMake在构建过程中使用指定的编译器。

回到顶部
AI 助手
你好,我是IT营的 AI 助手
您可以尝试点击下方的快捷入口开启体验!