Post

visual studo 使用小提示

  • 在vs 的包含目录中添加默认的包含路径

    在vs 中添加默认的包含路径,可以方便我们在任一工程中使用开发辅助工具:
    如:vld (一个非常好用的内存泄露检测工具)
    或者其他帮助调试或者分析问题的代码:如日志记录的头文件等。

如:

在如下位置添加文件,并内容

1
2
3
4
5
6
7
8
<!-- C:\Users\Qiang\AppData\Local\Microsoft\MSBuild\v4.0 具体路径依据当前ide 环境 -->
<?xml version="1.0" encoding="utf-8"?>   
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
<PropertyGroup>    
<IncludePath>D:\workspace\Qiang_Project\tools\vld\include;D:\workspace\Qiang_Project\tools\include;$(IncludePath)</IncludePath>  
<LibraryPath>D:\lib\vld\bin;$(LibraryPath)</LibraryPath> 
</PropertyGroup>    
</Project> 

当本地安装多个平台工具集,每个平台工具集会有自己的一份配置文件如:

1
2
3
4
5
6
7
Qiang@DESKTOP-A3275L6 MINGW64 ~/AppData/Local/Microsoft/MSBuild
$ find -iname "*props"
./target/Microsoft.Cpp.Win32.user.props
./v12.0/Microsoft.Cpp.Win32.user.props
./v14.0/Microsoft.Cpp.Win32.user.props
./v15.0/Microsoft.Cpp.Win32.user.props
./v4.0/Microsoft.Cpp.Win32.user.props

此时我们通过创建硬链接的方式使各工具集下的文件硬链接到一个指定文件上,如:./target/Microsoft.Cpp.Win32.user.props

1
mklink /H Microsoft.Cpp.Win32.user.props ..\target\Microsoft.Cpp.Win32.user.props

针对其他平台如:arm64

1
mklink /H Microsoft.Cpp.ARM64.user.props ..\target\Microsoft.Cpp.Win32.user.props
This post is licensed under CC BY 4.0 by the author.