[英]VS Code + MS C++ extension on linux - stuck on setup tutorial
I am new to VS Code (used VS Community eventually) and tried to set up VS Code on raspberry pi (pi-os) and PC (Debian) following Get Started with C++ on Linux in Visual Studio Code but got stuck on the part setting up the launch.json for debugging the helloworld.cpp - as there is no such selection (with similar or comparable naming) as shown in the tutorial.我是 VS Code 的新手(最终使用了 VS Community),并尝试在 Visual Studio Code 中的 Linux 上的 C++ 入门之后在树莓派(pi-os)和 PC(Debian)上设置 VS Code,但卡在了部分设置上启动 launch.json 以调试 helloworld.cpp - 因为教程中没有这样的选择(具有相似或可比较的命名)。 If I copy the example given in the tutorial I can start debugging but don't get any output in terminal or the debug-console (other than debugger info), neither in the loop nor from the last cout statement.如果我复制本教程中给出的示例,我可以开始调试,但不会在终端或调试控制台(除调试器信息外)中获得任何 output,无论是在循环中还是在最后一个 cout 语句中。
just feeling a little frustrated for being so... newb...只是因为如此……新手而感到有点沮丧……
Ok, finally got it working.好的,终于让它工作了。
It is best to choose C/C++: (gdb) Launch
for configuration and adapt the settings for program
and cwd
according to the tutorial.最好选择C/C++: (gdb) Launch
进行配置,并根据教程调整program
和cwd
的设置。
The section with prelaunch Task
is not really necessary if one builds prior to debugging.如果在调试之前构建,那么带有prelaunch Task
的部分并不是真正必要的。
If for any reason it is wanted, make sure to use the same name as in the tasks.json
under label
.如果出于任何原因需要它,请确保使用与tasks.json
下的label
中相同的名称。
If I insert a second如果我插入第二个
cout << endl
at the end, I see the output before the program terminates;最后,我在程序终止前看到了 output; that let me draw the conclusion that cout
output appears in whole lines
only.这让我得出结论,即cout
output 只出现在whole lines
中。
none the less the tutorial should be updated...尽管如此,应该更新教程......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.