cmake 因“CMake 错误:您的 CXX 编译器:未找到“CMAKE_CXX_COMPILER-NOTFOUND”而失败。”

xjo*_*ilx 59 compiling

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!
Run Code Online (Sandbox Code Playgroud)

使用自动工具,我得到了这个:

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
Run Code Online (Sandbox Code Playgroud)

pet*_*ief 92

安装build-essential安装 build-essential如果你还没有这样做。您可以在软件中心或通过以下方式安装它:

sudo apt-get update && sudo apt-get install build-essential
Run Code Online (Sandbox Code Playgroud)

  • 解决了我的问题! (4认同)

Tho*_*mas 19

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

apt-get install g++
Run Code Online (Sandbox Code Playgroud)


小智 5

我知道这是“Ask Ubuntu”,但是如果 Fedora 的人遇到这个问题,以下内容对我有帮助:

sudo dnf install gcc-c++
Run Code Online (Sandbox Code Playgroud)