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


52
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!

使用自动工具,我得到以下信息:

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

怎么which g++说呢?显然,系统上没有可用的c ++编译器。
2012年

它什么也没说。如果有帮助,我已经安装了GCC。
xjonquilx 2012年

Answers:


80

如果尚未安装build-essential安装基本版,请安装它。您可以在软件中心或通过以下方式安装它:

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

4
解决了我的问题!
kimliv

17

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

apt-get install g++

现在我得到了:/usr/share/cmake-2.8/Modules/FindKDE4.cmake:98(MESSAGE)的CMake错误:错误:在/home/jonquil/.kde/中找不到cmake / modules / FindKDE4Internal.cmake share / apps; / usr / share / kubuntu-default-settings / kde4-profile / default / share / apps; / usr / share / kde4 / apps调用堆栈(最新调用优先):CMakeLists.txt:6(find_package)
xjonquilx 2012年

您缺少构建环境,它不仅仅是编译器,还需要库等。看看这里以了解您的需求:help.ubuntu.com/community/CompilingEasyHowTo
Thomas

我知道有一个我可以在Ubuntu中安装的软件包,它将为我提供所有必要的软件包进行编译,我只是不记得它的名称。谢谢!
xjonquilx 2012年

我仍然遇到相同的错误。:(
xjonquilx 2012年

错误消息提示位于kde-kde开发未包含在build-essential中。不知道是否有一个meta包。
2012年

4

我知道这是“询问Ubuntu”,但是如果使用Fedora的人会遇到此问题,则以下内容可以帮助我:

sudo dnf install gcc-c++

就此特定论坛的目的而言,您是正确的。请注意,与Ubuntu发行版以外的其他发行版相关的问题和答案应发布在unix.stackexchange.com
Centaurus18年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.