问题分析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

删除即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值