栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

CMake Error: CMAKE

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

CMake Error: CMAKE

一、报错描述:

用CMake构建c++程序时报错:

$ cmake .
-- Building for: NMake Makefiles
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument  value or use a ... suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Error at CMakeLists.txt:2 (project):
  Running

   'nmake' '-?'

  failed with:

   系统找不到指定的文件。


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/eren.luo/Desktop/test/CMakeFiles/CMakeOutput.log".

二、解决办法:

p.s. mingw64/bin和cmake已添加至环境变量中。

  1. 编译时把
cmake .

改为:

cmake -G "MinGW Makefiles" .
  1. 运行时使用:
mingw32-make.exe all
三、C++和cmake版本:
  1. cmake-3.23.1-windows-x86_64.msi
  2. mingw-w64-install.exe

系统:Windows 10

四、参考文章:
  1. Running CMake on Windows
  2. CMAKE_C_COMPILER CMAKE_CXX_COMPILER not set
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/921111.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号