Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010: C/C++ global include and lib folder

Tags:

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?

Thank you.

like image 531
pic11 Avatar asked Jun 07 '11 12:06

pic11


People also ask

How do I add the include path in Visual Studio?

Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio. Select the Configuration Properties > C/C++ > General property page. Modify the Additional Include Directories property.

How do I show a folder in Visual Studio?

On the Visual Studio menu bar, choose File > Open > Folder, and then browse to the code location. On the context (right-click) menu of a folder containing code, choose the Open in Visual Studio command. Choose the Open Folder link on the start window.

What is a directory Visual Studio?

Usually a Visual Studio project directory is a sub-directory of a solution directory. However, it doesn't need to be. E.g. you can add a project to multiple solutions. For any given project, in the project settings the location of the project directory is available via the $(ProjectDir) macro expansion.


2 Answers

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.

like image 112
Jon Cage Avatar answered Oct 20 '22 18:10

Jon Cage


I found this article helpful.

like image 44
Bojan Komazec Avatar answered Oct 20 '22 19:10

Bojan Komazec