vs2013添加VC工程IncludePath、LibraryPath等路徑的方法
Visual C++ 項目屬性將定義在 %ProgramFiles(X86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms,該目錄下有ARM、Win32、X64三個文件夾
根據需要或者分別修改三個文件夾下的PlatformToolsets\v120\Toolset工程屬性文件,找到
<IncludePath Condition="'$(IncludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
這個是include路徑,可以直接添加絕對路徑或相對路徑
如果需要修改LibraryPath靜態庫文件,找到
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);</LibraryPath>
直接添加絕對路徑或相對路徑
可更改路徑還有SourcePath、ExcludePath,這里修改對所有工程都生效,無論是新建項目工程還是過去項目工程;
IncludePath的默認路徑在C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Common中,
<VC_IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include</VC_IncludePath>;
VCInstallDir定義為<VCInstallDir>$(VCInstallDir_120)</VCInstallDir>
VCInstallDir_120定義為:
<VCInstallDir_120 Condition="'$(VCInstallDir_120)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC@ProductDir)</VCInstallDir_120>,可見這個定義是在安裝的時候寫入注冊表的;
其他的VC編譯器宏都可以在這個文件中找到最原始的定義,都是在安裝vs的時候生成,寫入注冊表。
根據需要或者分別修改三個文件夾下的PlatformToolsets\v120\Toolset工程屬性文件,找到
<IncludePath Condition="'$(IncludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
這個是include路徑,可以直接添加絕對路徑或相對路徑
如果需要修改LibraryPath靜態庫文件,找到
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);</LibraryPath>
直接添加絕對路徑或相對路徑
可更改路徑還有SourcePath、ExcludePath,這里修改對所有工程都生效,無論是新建項目工程還是過去項目工程;
IncludePath的默認路徑在C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Common中,
<VC_IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include</VC_IncludePath>;
VCInstallDir定義為<VCInstallDir>$(VCInstallDir_120)</VCInstallDir>
VCInstallDir_120定義為:
<VCInstallDir_120 Condition="'$(VCInstallDir_120)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\12.0\Setup\VC@ProductDir)</VCInstallDir_120>,可見這個定義是在安裝的時候寫入注冊表的;
其他的VC編譯器宏都可以在這個文件中找到最原始的定義,都是在安裝vs的時候生成,寫入注冊表。
posted on 2016-02-20 17:55 Benjamin 閱讀(5561) 評論(0) 編輯 收藏 引用 所屬分類: VC