[英]$(OutDir) is not set to project Output directory
我在Visual Studio 2013中有一個C ++ / CLI dll項目,我正在嘗試更改輸出目錄。 我已經在“項目屬性”>“常規”中將“輸出目錄”設置設置為$(SolutionDir)Stage\\$(Configuration)\\bin$(PlatformArchitecture)\\
。 我可以在vcxproj文件中看到這反映到OutDir:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)Stage\$(Configuration)\bin$(PlatformArchitecture)\</OutDir>
</PropertyGroup>
但是,它似乎並未實際使用 。 在鏈接器>常規>輸出文件下,默認值為$(OutDir)$(TargetName)$(TargetExt)
,但在命令行下看到的$(OutDir)
的擴展值不能反映我所做的更改,而是具有$(SolutionDir)Stage\\$(ConfigurationName)
( $(ConfigurationName)
例如為“ Debug_x64”)。 這很奇怪,因為vcxproj文件中不存在該文件...
我需要怎么做才能使輸出目錄中的更改影響$(OutDir)
? 我還注意到有一個宏$(OutDirWasSpecified)
,其值為false。
我相信$(OutDir)
通常在文件中設置:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.default.props
或者,如果在32位平台上:
...\Win32\Microsoft.Cpp.Win32.default.props
通常,您會在項目文件中找到:
MyProject.vcxproj
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
並且如果找到Microsoft.Cpp.Default.props
文件,它將具有:
<!-- Allow platforms to define the defaults first -->
<Import Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\Microsoft.Cpp.$(Platform).default.props')" Project="$(VCTargetsPath)\Platforms\$(Platform)\Microsoft.Cpp.$(Platform).default.props"/>
$OutDir
被引入的地方。
似乎此包含鏈被某種程度破壞了,或者$(OutDir)
的原始定義在Microsoft.Cpp.x64.default.props
文件中被擦除/修改。
值得的是,我的Visual Studio 2013配置有點不同。 我有一個根文件夾C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp
,下面是兩個子文件夾: C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V110
和C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V120
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.