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

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.

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.

I found this article helpful.

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.

Related

Any way to include a batch of Library and Directory paths to "Include Additional Directories" Visual C++

Currently, when working on a new solution in Microsoft Visual Studio 2017 (C++), my team has to include a bunch of libraries and directories individually. Which is tedious and prone to mistakes. Is there anyway to be able to include one path(Environment Variable) in "Additional Include Directories" that contains all the paths to the "Includes" we need without individually including each and every path or any other solution? Right now, when we create a new solution we have to repeatedly add every solution individually.
Go to view->Other windows->Property manager and then open one of the project nodes and then one node for each of the platforms of interest (that is Debug|Win32, Debug|X64), and right click on the Microsoft.Cpp..User node and select properties.
Now, you can edit this property page just like a project properties but the settings will be applied to all projects (even already created projects).

How do I modify the include paths used by a Visual C++ project is VS 2015?

I am developing a simple C++ application in VS2015. I am getting the error message "Cannot open source file "math". So I right click the project in the solution explorer and navigate to the VC++ Directories, click the "Include Directories" entry in the right-hand pane, pull down the combo box and choose "".
The "Include Directories" dialog appears and is completely read only. I can click the "Macros>>" button and see a list of include macros, but there is no way to add them to your project.
All configuration-dependant properties, including the INCLUDE, are edited in the property-sheets:
Open the Tab "Property Manager", navigate to your configuration (i.e. "Debug | 64"), double click, and enter the include path there. (Save your edits)
Additional project-dependant INCLUDE: Open project's properties (project/Properties in Solution Manager. Navigate to "C++/Additional includes". There you can set additional includes, even if other parts of the property-dialog are readonly).
Math: Following include should be available from VS2015 environment:
#include <math.h>

How to Find What a Project Inherit's It's Additional Include Directories From

I have a project that is directly under the solution, it isn't nested in another project. Yet it has tons of values in it's "Additional Include Directories">"Inherited values":
I want to modify these, but where should I look for where these are defined?
This information is coming from the properties. You can see those on a per project basis in the "Property Manager" (I've attached a picture of my "View">"Other Windows">"Property Manager" but Assimilater has pointed out that the location may not be consistent across Visual Studio editions.)
In your Property Manager window you'll need to find your projects properties. Find your project and open the folder for the configuration you wish to modify. Right click on: "Local settings (specific for all projects in the directory)" and select "Properties".
From there you can edit "Common Properties">"C/C++">"General"'s "Additional Include Directories". Anything added here will show up in the "Inherited values" of your projects "Additional Include Directories" dialog.
I've validated that this information is consistent on Visual Studio 2008, 2010, 2012, 2013, and 2015.
You can read a more in depth piece on how to use properties here: http://blogs.msdn.com/b/vsproject/archive/2009/06/23/inherited-properties-and-property-sheets.aspx

Reset property page settings Visual Studio C 2010 Express

I made some changes to the Property Pages/Configuration Properties a long time ago and I'd like to reset them. I changed stuff like the output directory, code generation settings, etc.
I've tried resetting all environment settings from the Import and Export Settings Wizard. I've also tried the devenv /resetsettings command. Both of which did not work. Reinstalling doesn't work either. May I get some advice on how to restore everything back to the default.
Thank you.
If I understand you correctly, you are trying to revert to old settings for the Project -> Properties.
This information is stored in the project itself, not in Visual Studio. Look for a file with the extension vcxproj in the solution folder.
You can edit it with Notepad (notepad++), or - you can edit it inside Visual Studio, by
right-click the project, unload it, then edit project file, then reload project
Be careful how you edit these settings.
For best results, create a new solution, with a new project, and compare the settings from the newly created project with the existing one.
edit: on my computer (I have VS Ultimate I think, but it shouldn't matter):
To edit, go to Project -> Properties -> VC++ Directories, and on each, at the end of the line, press the arrow down, and click Edit...
VC++ directories:
$(VCInstallDir)bin
$(WindowsSdkDir)bin\NETFX 4.0 Tools
$(WindowsSdkDir)bin
$(VSInstallDir)Common7\Tools\bin
$(VSInstallDir)Common7\tools
Include Directories:
$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)include
$(FrameworkSDKDir)\include
from what I see in the directions you pointed out, all you have to do is remove from your list, the directories that you no longer want.
In c/c++ -> Code Generation ->
enable minimal rebuild: NO
enable c++ exceptions: YES (/EHSC)
Basic Runtime Checks - Both
/MTd
...
General -> Output directory:
not sure what is the default, I would put something like
$(SolutionDir)bin\$(Platform)\$(Configuration)\
Also, there seems to be a property sheet that may have been added to your project...
You can generally see the Property Manager from View -> Properties Window (F4).
here, you can expand the project configurations, and simply delete any property sheets you may not want (I expect a new project to have no property sheets).

Eclipse CDT add existing source without copying

I have a C++ project proj1 with some source files in, however I would like to also use some of the source files I have in another project proj2. proj1 and proj2 are both subdirs of a directory my_projects. I don't want eclipse to copy the files as I want to ensure I have only one copy to edit. This is like the "add existing item" option of MS Visual Studio.
The end result I'm aiming for is to be able to create makefiles for both proj1 and proj2, zip up the two directories together and send them to coworkers so they can build the two projects themselves using make.
Is this possible in Eclipse? I've searched and haven't found the solution.
Phil
If you have proj2 open in Eclipse right click on the project and choose Import... and then select General > FileSystem and hit next. In the top window choose the directory in proj1 that contains the resources you want to link. After selecting the files you want to link in the top window hit the Advanced button to open up a submenu and select Create Links in Workspace as shown in this screenshot:
This question addresses setting up a Makefile with relative instead of absolute paths: Getting Eclipse CDT to use relative include paths in generated Makefiles
I looked forever for a solution to this, and I finally found it. Right click on the project and select Build Settings. Under the Build header on the left click "Settings". Then under the "Tool Settings" tab click "Directories" under the compiler header. Then click the add button at the top. If the desired files are in another project in the same workspace click the workspace button and then navigate to the exact folder where the files are. Once you have done this voila! you should be able to build the project!