Visual Studio 2010:C/C++ 全局包含和 lib 文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6265164/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2010: C/C++ global include and lib folder
提问by pic11
How to make user include and lib folders globally and permanently available to all projects? In Visual Studio 2008 it is Tools -> Options -> Projects and Solutions -> VC++ Directories
. In 2010 it says deprecated... blah blah... instead use property sheets... click '?' for help...
. Click and it takes you to a web page about property sheets. Doesn't answer the basis question. How to set user library folders globally, once and for all?
如何使用户包含和 lib 文件夹全局且永久可用于所有项目?在 Visual Studio 2008 中,它是Tools -> Options -> Projects and Solutions -> VC++ Directories
. 在 2010 年它说deprecated... blah blah... instead use property sheets... click '?' for help...
。单击它会将您带到有关属性表的网页。不回答基本问题。如何一劳永逸地全局设置用户库文件夹?
Thank you.
谢谢你。
回答by Jon Cage
Try this:
试试这个:
VC++ Directories are no longer supported in VS2010 through Tools->Options page. Instead, VS2010 introduces the user settings file (Microsoft.cpp..users.props) to control global settings including Global search path. These files are located at $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 directory. Upon migration to VS2010, the custom settings of VC++ Directories from VS2005 or VS2008 are migrated to these user files. These global settings files are imported into all the converted and newly created projects.
Here are the steps to change the settings file through UI:
- Open up property manager by clicking on View.Property Manager.
- Expand the project node and then the Configuration|Platform nodes, you will see "Microsoft.cpp..users" file for each Configuration|Platform. These are the files for the global settings, similar to the old tools/Options/VC++ Directories.
- Multi-Select "Microsoft.cpp..users", right click and bring up the property page window
- In the property page window, click on "VC++ Directories" (for example) in the left pane, add new paths for the directories such as "Include Directories". separated by semicolons
- Make sure to save the settings before shutting down Visual Studio.
- Re-launch Visual Studio and the new settings will be in effect.
Note: If you would like to only change the settings for one project, you can right click on the project and bring up the property page. Change the settings for “VC++ Directories”, these settings will be persisted to the project file.
VS2010 不再通过工具->选项页面支持 VC++ 目录。相反,VS2010 引入了用户设置文件(Microsoft.cpp..users.props)来控制全局设置,包括全局搜索路径。这些文件位于 $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 目录中。迁移到 VS2010 后,来自 VS2005 或 VS2008 的 VC++ 目录的自定义设置将迁移到这些用户文件。这些全局设置文件被导入到所有转换后和新创建的项目中。
以下是通过 UI 更改设置文件的步骤:
- 单击 View.Property Manager 打开属性管理器。
- 展开项目节点,然后展开 Configuration|Platform 节点,您将看到每个 Configuration|Platform 的“Microsoft.cpp..users”文件。这些是全局设置的文件,类似于旧的工具/选项/VC++ 目录。
- 多选“Microsoft.cpp..users”,右击弹出属性页窗口
- 在属性页窗口中,单击左窗格中的“VC++ 目录”(例如),为目录添加新路径,例如“包含目录”。用分号隔开
- 确保在关闭 Visual Studio 之前保存设置。
- 重新启动 Visual Studio,新设置将生效。
注意:如果您只想更改一个项目的设置,您可以右键单击该项目并调出属性页面。更改“VC++目录”的设置,这些设置将保留到项目文件中。
回答by Ahmed Bahtity
You can select all the project and edit them all at once.
您可以选择所有项目并一次性编辑它们。
- Open the class view and select all projects.
- select configuration properties node and then VC++ directories.
- select Included Directories, Libraries Directories and click the button next to it. Select edit and enter the additional paths you need, this will be add to all the selected projects.
- You can delete any common directories among the selected projects.
- 打开类视图并选择所有项目。
- 选择配置属性节点,然后选择 VC++ 目录。
- 选择包含的目录、库目录并单击它旁边的按钮。选择编辑并输入您需要的附加路径,这将添加到所有选定的项目中。
- 您可以删除所选项目中的任何公共目录。