gpt4 book ai didi

ubuntu - CXX Cmake 编译器未知

转载 作者:太空宇宙 更新时间:2023-11-03 17:07:13 26 4
gpt4 key购买 nike

 ./cmake-3.4.1/bin/cmake ..
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (project):
The CMAKE_CXX_COMPILER:

/usr/bin/c++

is not a full path to an existing compiler tool.

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.

说它无效,但是

/usr/bin/c++ is a valid path

为什么会出现这个错误?

我试过运行

/cmake-3.4.1/bin/cmake -DCMAKE_CXX_COMPILER=/usr/bin/c++

还是报错

编辑

xmr-stak/build# ./cmake-3.4.1/bin/cmake ../ -DCMAKE_CXX+COMPILER=/usr/bin/g++
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:1 (project):
The CMAKE_CXX_COMPILER:

/usr/bin/c++

is not a full path to an existing compiler tool.

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.


-- Configuring incomplete, errors occurred!
See also "/root/monero/xmr-stak/build/CMakeFiles/CMakeOutput.log".
See also "/root/monero/xmr-stak/build/CMakeFiles/CMakeError.log".

来自 cmake 日志:

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags:
Id flags:

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/c++
Build flags:
Id flags: -c

The output was:
No such file or directory

最佳答案

我非常怀疑你有拼写错误(注意 g++ 中的 g):

cmake ../ -DCMAKE_CXX_COMPILER=/usr/bin/g++

如果您确实有名为 c++ 的编译器可执行文件,请确保以下内容有效:

$ /usr/bin/c++ --version

关于ubuntu - CXX Cmake 编译器未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49702384/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com