ubuntu cmake..中出现Could not find cmake module file Error required internal CMake variable not set,的问题
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
任重而道远啊…
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源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))时的类型转换总结