如何安装Cmake C编译器和CXX编译器 [英] How to install Cmake C compiler and CXX compiler

查看:1687
本文介绍了如何安装Cmake C编译器和CXX编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助编译这个项目与cmake。这是错误讯息。

  $ ./build_avida 
- 构建于:NMake Makefiles
CMakeLists.txt中的警告:1(PROJECT):
要使用NMake生成器,cmake必须从可以从命令行使用
编译器cl的shell运行。此环境不包含
INCLUDE,LIB或LIBPATH,这些必须为cl编译器设置为
工作。


CMake错误:CMake无法找到对应于NMake Makefiles的构建程序。未设置CMAKE_MAKE_PROGRAM。您可能需要选择一个不同的构建工具。
CMake错误:需要内部CMake变量未设置,需要CMake可能无法正确构建。
缺少变量是:
CMAKE_C_COMPILER_ENV_VAR
CMake错误:需要内部CMake变量未设置,可能无法正确构建cmake。
缺少变量是:
CMAKE_C_COMPILER
CMake错误:找不到cmake模块文件:C:/ Users / Desk / Dropbox / 2012-2013 / BCB504 / AvidaProject / avidagit / avida / CMakeFiles / 2.8.10.2/CMakeCCompiler.cmake
CMake错误:需要内部CMake变量未设置,cmake可能不能正确构建。
缺少变量是:
CMAKE_CXX_COMPILER_ENV_VAR
CMake错误:需要内部CMake变量未设置,cmake可能无法正确构建。
缺少变量是:
CMAKE_CXX_COMPILER
CMake错误:找不到cmake模块文件:C:/ Users / Desk / Dropbox / 2012-2013 / BCB504 / AvidaProject / avidagit / avida / CMakeFiles / 2.8.10.2/CMakeCXXCompiler.cmake
CMake错误:CMAKE_C_COMPILER未设置,在EnableLanguage后
CMake错误:CMAKE_CXX_COMPILER未设置,在EnableLanguage后
- 配置不完整,发生错误!
make:***没有规则使目标`install'。停止。


解决方案

尝试安装 gcc gcc-c ++ ,因为Cmake与他们平滑。



/ h3>

  yum install gcc gcc-c ++ 



Debian /基于Ubuntu的



  apt-get install cmake gcc g ++ 



然后,


  1. 移除'CMakeCache .txt'

  2. 再次运行编译。


I need some help compiling this project with cmake. Here is the error message.

$ ./build_avida
-- Building for: NMake Makefiles
CMake Warning at CMakeLists.txt:1 (PROJECT):
  To use the NMake generator, cmake must be run from a shell that can use the
  compiler cl from the command line.  This environment does not contain
  INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
  work.


CMake Error: CMake was unable to find a build program corresponding to "NMake Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:C:/Users/Desk/Dropbox/2012-2013/BCB504/AvidaProject/avidagit/avida/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:C:/Users/Desk/Dropbox/2012-2013/BCB504/AvidaProject/avidagit/avida/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
make: *** No rule to make target `install'.  Stop.

解决方案

Try to install gcc and gcc-c++, as Cmake works smooth with them.

RedHat-based

yum install gcc gcc-c++

Debian/Ubuntu-based

apt-get install cmake gcc g++

Then,

  1. remove 'CMakeCache.txt'
  2. run compilation again.

这篇关于如何安装Cmake C编译器和CXX编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆