mac系统如何使用vscode运行C语言
Unable to start debugging. Program path ‘/Users/ling/Learning/frontEnd/web/Test/main.cpp’ is missing or invalid.
LLDB failed with message: Command ‘file-exec-and-symbols’. Target binary ‘/Users/ling/Learning/frontEnd/web/Test/main.cpp’ is invalid. error: ‘/Users/ling/Learning/frontEnd/web/Test/main.cpp’ doesn’t contain any ‘host’ platform architectures: arm64e, arm64, x86_64, x86_64,
不知道为什么调试时总报错,还没解决。。。
先参考vsCode Mac版 配置C/C++,并运行代码暴力调试法
在终端运行以下代码
clang++ main.cpp
clang++ main.cpp -o main-result
./main-result
clang++ sub.cpp
/** a.out是可执行文件,每运行一次cpp会替换a.out的内容 */
./a.out