Visual Studio C + + manual management of header file methods that contain paths

Source: Internet
Author: User


Here, take VS2010 as an example of how to manually manage VC + + directories by customizing project properties.

The first step: Open a VC + + project.


Step Two: Select Property Manager under the View menu.


Step Three: Right-click on our project and select "Add New Project property sheet".


Fourth step: Enter your own good name, note the directory do not modify, it is recommended to put in their own project directory, this is the default.


Fifth Step: Click Add, go back to our engineering directory, should be able to find bt.props this file.


Sixth step: Open the file with the editing tool, it is an XML file, you can choose the useful editing tools.

<?xml version= "1.0" encoding= "Utf-8"?> <project toolsversion= "4.0" xmlns= "http://schemas.microsoft.com/ developer/msbuild/2003 ">  <importgroup label=" PropertySheets "/>  <propertygroup Label=" Usermacros "/>  <propertygroup/>  <itemdefinitiongroup/>  <itemgroup/></ Project>

Seventh Step: Edit the new property sheet with the interface.



Use the interface to edit VC + + directory settings, click Save All, go back to our engineering directory, open the Bt.props file, the content has changed.

Edit Result:


Note the Save button is here:


Eighth step: Directly hit the Bt.props file, manually add the include path, mainly for the project contains a lot of paths.


<?xml version= "1.0" encoding= "Utf-8"? ><project toolsversion= "4.0" xmlns= "http://schemas.microsoft.com/ developer/msbuild/2003 ">  <importgroup label=" PropertySheets "/>  <propertygroup Label=" Usermacros "/>  <PropertyGroup>    <includepath>f:\youxi;$ (includepath) </IncludePath>    <includepath>f:\youxi\1;$ (includepath) </IncludePath>    <includepath>f:\youxi\2;$ ( Includepath) </IncludePath>    <includepath>f:\youxi\3;$ (includepath) </IncludePath>    < includepath>f:\youxi\4;$ (Includepath) </IncludePath>    <includepath>f:\youxi\5;$ (Includepath) </IncludePath>    <includepath>f:\youxi\6;$ (includepath) </IncludePath>    <includepath >$ (Includepath) </IncludePath>  </PropertyGroup>  <itemdefinitiongroup/>  < ItemGroup/></project>


Note that you can write the table of contents to a single line, and then separate them with semicolons, either in the same way as you set the environment variables, or in the same line as shown above, but each row is appended with $ (includepath).


Nineth Step: Restart the project, open the project VC + + directory settings look at it:


The advantage of this approach is that a library does this once, and if other projects require these include paths, you can choose to add an existing property sheet in the Add property sheet, and then import the Bt.props file, then the new project automatically inherits the included path that we set up.


In addition to the header file containing the path, there are many other properties that can be set in this way and shared across multiple projects.




Visual Studio C + + manual management of header file methods that contain paths

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.