对于C/C++ VSCODE中的语法突出显示:如何告诉vscode是“ -dxxxx”编译选项。会使用吗?
在开发微控制器时,我们使用大量通过“-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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您已安装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.