【问题标题】:CXX Cmake Compiler is unknownCXX Cmake 编译器未知
【发布时间】:2018-04-06 23:46:52
【问题描述】:
 ./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

【问题讨论】:

    标签: ubuntu gcc cmake


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 您好,感谢您的建议。我又试了一次,发布命令+输入加输出。我查看了日志文件,它显示丢失.. 我尝试了/usr/bin/c++(and g++) --version,它们都丢失了。我想我会尝试全新安装.. 整个系统
    猜你喜欢
    • 2023-03-16
    • 1970-01-01
    • 2014-01-05
    • 2016-03-04
    • 2022-07-12
    • 1970-01-01
    • 1970-01-01
    • 2016-10-25
    • 1970-01-01
    相关资源
    最近更新 更多