对于C/C++ VSCODE中的语法突出显示:如何告诉vscode是“ -dxxxx”编译选项。会使用吗?

发布于 2025-01-17 07:50:19 字数 105 浏览 6 评论 0原文

在开发微控制器时,我们使用大量通过“-Dxxxx”语法传递给编译器的编译时定义。 我想配置 vscode,使其知道将提供某些定义,并突出显示与这些信息正确对应的代码。

我该怎么做呢?

When developing for micro controller, we use a lot of compile-time defines passed to the compiler with the "-Dxxxx" syntax.
I would like to configure vscode such that it knows that certain defines will be provided and such that it highlights code properly corresponding to those info.

How would I do that ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彡翼 2025-01-24 07:50:19

我假设您已安装C/C++ 扩展

1 - 通过 Ctrl + Shift + P 或 View 打开命令面板 ->命令面板...
2 - 选择C/C++:编辑配置 (UI)
3 - 向下滚动到 Defines 部分,您可以在其中添加定义/宏。

此外,在此选项卡中您可以告诉 vscode 您的编译器选项,例如,编译器参数、您正在使用的语言标准、包含路径等。

I am assuming you have C/C++ extension installed.

1 - Open Command Palette by Ctrl + Shift + P or View -> Command Palette...
2 - Select C/C++: Edit Configurations (UI)
3 - Scroll down to Defines section, where you can add your defines/macros.

Also, In this tab you can tell vscode about your compiler options such as, the compiler arguments, the language standard you are using, include paths, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文