问题分析4
问题分析 4
CMake-tools 不能正常工作【已解决】
[main] 正在配置项目: CppLearn
[proc] 执行命令: /usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -C /home/pomegranate/workspace/CppLearn -S/home/pomegranate/workspace/CppLearn -B/home/pomegranate/workspace/CppLearn/build
[cmake] Not searching for unused variables given on the command line.
[cmake] loading initial cache file /home/pomegranate/workspace/CppLearn
[cmake] CMake Error: Error processing file: /home/pomegranate/workspace/CppLearn
[cmake] -- SOURCES: /home/pomegranate/workspace/CppLearn/practice/chapter12/a.cpp;/home/pomegranate/workspace/CppLearn/practice/chapter12/main.cpp
[cmake] -- HEADERS: /home/pomegranate/workspace/CppLearn/practice/chapter12;thirdpaties/Plog/include
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/home/pomegranate/workspace/CppLearn/build/CMakeFiles/CMakeOutput.log".
[proc] 命令“/usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -C /home/pomegranate/workspace/CppLearn -S/home/pomegranate/workspace/CppLearn -B/home/pomegranate/workspace/CppLearn/build”已退出,代码为 1
问题猜想:/usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -C /home/pomegranate/workspace/CppLearn -S/home/pomegranate/workspace/CppLearn -B/home/pomegranate/workspace/CppLearn/build
命令有误【确凿】
验证:命令行运行该命令
Not searching for unused variables given on the command line.
loading initial cache file /home/pomegranate/workspace/CppLearn
CMake Error: Error processing file: /home/pomegranate/workspace/CppLearn
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SOURCES: /home/pomegranate/workspace/CppLearn/practice/chapter12/a.cpp;/home/pomegranate/workspace/CppLearn/practice/chapter12/main.cpp
-- HEADERS: /home/pomegranate/workspace/CppLearn/practice/chapter12;thirdpaties/Plog/include
-- Configuring incomplete, errors occurred!
See also "/home/pomegranate/workspace/CppLearn/build/CMakeFiles/CMakeOutput.log".
问题猜想:-C XXX
选项有误【确凿】
验证:删除 -C 重新允许命令
Not searching for unused variables given on the command line.
-- SOURCES: /home/pomegranate/workspace/CppLearn/practice/chapter12/a.cpp;/home/pomegranate/workspace/CppLearn/practice/chapter12/main.cpp
-- HEADERS: /home/pomegranate/workspace/CppLearn/practice/chapter12;thirdpaties/Plog/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pomegranate/workspace/CppLearn/build
解决方法:配置 cmake-tools 插件的行为,排查全局 settings.json【有效】
"cmake.cacheInit": "" // 发现官方脚本 Bug
删除即可
原文地址:https://blog.csdn.net/2303_78834656/article/details/146531474
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.kler.cn/a/612410.html 如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.kler.cn/a/612410.html 如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!