当前位置: 首页>>技术问答>>正文


cmake失败,出现“CMake错误:您的CXX编译器:”找不到“CMAKE_CXX_COMPILER-NOTFOUND”。

,

问题描述

jonquil@jonquil-Satellite-L755D:~/Downloads/akonadi-googledata-1.2.0/build$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at /usr/share/cmake-2.8/Modules/FindKDE4.cmake:98 (MESSAGE):
  ERROR: cmake/modules/FindKDE4Internal.cmake not found in
  /home/jonquil/.kde/share/apps;/usr/share/kubuntu-default-settings/kde4-profile/default/share/apps;/usr/share/kde4/apps
Call Stack (most recent call first):
  CMakeLists.txt:6 (find_package)


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

使用autotools,我得到了这个:

jonquil@jonquil-Satellite-L755D:~/Downloads/akonadi-googledata-1.2.0/build/build$ autoreconf -i -f
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 196.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 196.
autoreconf: `configure.ac' or `configure.in' is required

最佳解决办法

如果您还没有安装build-essential,请安装它。您可以将其安装在软件中心或使用:

compiling,ubuntu

sudo apt-get update && sudo apt-get install build-essential

次佳解决办法

gcc不包含g ++,这些是不同的包。安装g ++:

compiling,ubuntu

apt-get install g++

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/2390.html,未经允许,请勿转载。