加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cmake – C编译器标识未知

发布时间:2020-12-16 09:53:08 所属栏目:百科 来源:网络整理
导读:我想编译一个C程序.当我运行cmake时 build]$cmake ../ -- The C compiler identification is unknown -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /usr/share/cmake-3.0/Modules/
我想编译一个C程序.当我运行cmake时

build]$cmake ../
    -- The C compiler identification is unknown
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- broken
    CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message):
      The C compiler "/usr/bin/cc" is not able to compile a simple test program.

它失败并带有以下输出:

Change Dir: /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp

  Run Build Command:"/usr/bin/make" "cmTryCompileExec3431547622/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec3431547622.dir/build.make
  CMakeFiles/cmTryCompileExec3431547622.dir/build

  make[1]: Entering directory
  '/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp'

  /usr/bin/cmake -E cmake_progress_report
  /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object
  CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o

  /usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o
  -c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c

  /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared
  libraries: libisl.so.13: cannot open shared object file: No such file or
  directory

  CMakeFiles/cmTryCompileExec3431547622.dir/build.make:57: recipe for target
  'CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o' failed

  make[1]: *** [CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o]
  Error 1

  make[1]: Leaving directory
  '/home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp'

  Makefile:118: recipe for target 'cmTryCompileExec3431547622/fast' failed

  make: *** [cmTryCompileExec3431547622/fast] Error 2


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete,errors occurred!
See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeOutput.log".
See also "/home/vahid/dev/Indexer/build/CMakeFiles/CMakeError.log".

为什么会出现这种错误?我该如何解决?

解决方法

why this error occured?

根据此错误消息:

/usr/bin/cc -o CMakeFiles/cmTryCompileExec3431547622.dir/testCCompiler.c.o -c /home/vahid/dev/Indexer/build/CMakeFiles/CMakeTmp/testCCompiler.c

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1: error while loading shared libraries: libisl.so.13: cannot open shared object file: No such file or directory

看起来你的编译器不起作用.

how i can fix it?

重新安装工具链应该是解决它的最简单方法.

如何做到这一点取决于您的操作系统,如果您使用像Debian这样的Linux发行版,您可以使用类似apt-get install build-essential的东西来安装它;如果你使用Fedora或CentOS,你可以使用yum group install c-development.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读