如何在 VSCode 编辑器中为 .cpp 文件显示警告? [英] How to show warnings in VSCode editor for a .cpp file?

查看:40
本文介绍了如何在 VSCode 编辑器中为 .cpp 文件显示警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过某种方式调整 VSC 以在文本编辑器中查看 GCC 警告?
请参阅下面的屏幕截图 - 它仅显示编辑器中的错误.

Is it possible to tweak VSC somehow to see GCC warnings in the text editor?
Refer to the screenshot below - it shows only errors in the editor.

我使用的是 1.43.2 版本,并安装了 C/C++ 扩展 0.26.3.
尝试将 -Wall 编译器标志添加到 tasks.json 中的args",但没有帮助.

I'm using 1.43.2 version with C/C++ extension 0.26.3 installed.
Tried adding -Wall compiler flag to "args" in tasks.json but it didn't help.

以下是我的设置:

{
    "editor.fontSize": 13,
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 100,
    "files.insertFinalNewline": true,
}

推荐答案

警告和错误显示在问题面板中.你可以在上面看到Problems 4.您可能需要安装 Visual Studio IntelliCodeC++ Intellisense 以帮助您在编译前识别错误.

The warning and errors are shown in Problem Panel. You can see Problems 4 on it. You might need to install Visual Studio IntelliCode or C++ Intellisense to help you identify mistakes before compilation.

这篇关于如何在 VSCode 编辑器中为 .cpp 文件显示警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆