DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  4737 随笔 :: 2 文章 :: 542 评论 :: 1615万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

ubuntu cmake…中出现的问题

在写一个helloworld的小工程,然后cmakelists如下

cmake_minimum_required( VERSION 2.8)
project (hello world)
add_executable(helloworld main.cpp)

执行cmake…
结果出现报错

CMake Error: Could not find cmake module file: CMakeDetermineworldCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_world_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_world_COMPILER
CMake Error: Could not find cmake module file: /home/south/code/123/CMakeFiles/3.16.3/CMakeworldCompiler.cmake
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_world_COMPILER could be found.

  Tell CMake where to find the compiler by setting the CMake cache entry
  CMAKE_world_COMPILER to the full path to the compiler, or to the compiler
  name if it is in the PATH.


CMake Error: Could not find cmake module file: CMakeworldInformation.cmake
CMake Error: CMAKE_world_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/south/code/123/CMakeFiles/CMakeOutput.log".

上网找了很多的相关问题,有说需要用yum安装cmake的还有说是版本问题的
一一试过都不行,最后发现问题出在project()里面不能有空格。。。。。。。。

空格删掉最终cmake …成功

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/south/code/123

任重而道远啊…

 
posted on   DoubleLi  阅读(886)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2019-06-05 CreateProcess执行一个控制台程序,隐藏窗口
2018-06-05 搜集C++实现的线程池
2012-06-05 VC++的DLL应用(含Demo演示)
2012-06-05 vs2008 C# 怎么调试C++ dll
2012-06-05 C#调用dll(C++(Win32))时的类型转换总结
点击右上角即可分享
微信分享提示