且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将include/lib目录添加到MSVC 2015解决方案中的所有项目?

更新时间:2023-10-05 12:42:40

不直观的第一步是在解决方案资源管理器"窗口中选择多个项目.如有必要,请首先折叠项目节点.单击第一个项目,然后按住Shift键并单击最后一个项目.如有必要,可以通过使用Ctrl + Click从选择项中删除或重新添加项目来对选择项进行更改.然后右键单击>属性.

The non-intuitive first step is to select multiple projects in the Solution Explorer window. Collapse the project nodes first if necessary. Click the first project then Shift+Click the last project. Make changes to the selection if necessary by using Ctrl+Click to remove or re-add projects from/to the selection. Then Right-Click > Properties.

选择VC ++目录,然后对包括目录"设置进行更改.

Select VC++ Directories and make your changes to the Include Directories setting.

如果合适,您可以首先将对话框顶部的配置"组合框更改为所有配置",或者将平台"组合框更改为所有平台",以便将更改应用于所有配置和/或平台.请注意,可能会将设置更改为<different options>,然后只能合并新添加的内容.

If appropriate you can first change the Configuration combobox at the top of the dialog to "All Configurations" or the Platform combobox to "All Platforms" so the changes apply to all configurations and/or platforms. Beware that might change a setting to <different options>, it can then only merge new additions.

一种完全不同的方法是创建所有项目都使用的属性表.设置它仍然很繁琐,但希望您只需要执行一次.使用查看">((其他Windows)>属性管理器"将其启动.您也可以在其中使用Shift + Click技巧,这对向所有属性表添加新的属性表很有用. 此现有问答集对此进行了讨论.

A completely different way to do this is by creating a property sheet that all projects use. It is still tedious to set this up but hopefully you'll only need to do this once. Kick that off with View > (Other Windows) > Property Manager. You can use the Shift+Click trick there as well, useful to add a new property sheet to all of them. This existing Q+A talks about it.