我正在查看我的visual studio项目的属性并看到以下内容:
$(OutDir)\$(ProjectName).exe
我很好奇视觉工作室如何知道outdir的价值,我怎么能看到这个价值。而且,这是哪种语言,例如C#,python?换句话说,用$(OutDir)\$(ProjectName).exe
写的是什么语言
答案 0 :(得分:21)
$(OutDir)
是Visual Studio构建属性宏。
您可以在许多“属性”对话框中使用宏>> 按钮查看宏的值。
例如,在属性 - >常规 - >输出目录中,单击值文本框中的下拉列表,选择编辑... ,然后在生成对话框,单击宏>> 按钮。这将为您提供所有宏及其当前值的列表。
$(OutputDir)
应设置为当前配置的输出目录,例如$(SolutionDir)/$(Configuration)\
。
请注意,您的Windows环境变量在项目中作为Build Property宏导入,因此在marco列表中,您将看到,例如: $(Path)
,$(HOME)
,$(TEMP)
。
答案 1 :(得分:4)
Microsoft在主题Macros for Build Commands and Properties中记录了这些宏。 (该链接适用于Visual Studio 2015。)
答案 2 :(得分:1)
这些是MSBuild属性。它们可以是用户定义的或环境变量。
答案 3 :(得分:0)
您可以修改文件the_name_of_your_prog.VCPROJ
(在示例中:ttfmfc)
并用F:\ debug替换:$(SolutionDir)$(ConfigurationName)
和$(SolutionDir)
(F:\ debug在ramdisk或任何其他的foler中)
在下面的示例中,仅更改了调试配置:
视觉工作室2008
将每个[by(低于符号)和]替换为(大于符号)
[?xml version="1.0" encoding="Windows-1252"?]
[VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ttsmfc"
ProjectGUID="{0B52B3C5-7AD5-4780-92E9-98674E486261}"
RootNamespace="ttsmfc"
Keyword="MFCProj"
TargetFrameworkVersion="196613"
]
[Platforms]
[Platform
Name="Win32"
/]
[/Platforms]
[ToolFiles]
[/ToolFiles]
[Configurations]
[Configuration
Name="Debug|Win32"
OutputDirectory="F:\Debug"
IntermediateDirectory="F:\Debug"
ConfigurationType="1"
UseOfMFC="2"
CharacterSet="1"
]
[Tool
Name="VCPreBuildEventTool"
/]
[Tool
Name="VCCustomBuildTool"
/]
[Tool
Name="VCXMLDataGeneratorTool"
/]
[Tool
Name="VCWebServiceProxyGeneratorTool"
/]
[Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName="f:\Debug/ort.tlb"
HeaderFileName=""
/]
[Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile="F:\Debug/ort.pch"
AssemblerListingLocation="F:\Debug/"
ObjectFile="F:\Debug/"
ProgramDataBaseFileName="F:\Debug/"
WarningLevel="3"
DebugInformationFormat="4"
/]
[Tool
Name="VCManagedResourceCompilerTool"
/]
[Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"
AdditionalIncludeDirectories="$(IntDir)"
/]
[Tool
Name="VCPreLinkEventTool"
/]
[Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/]
[Tool
Name="VCALinkTool"
/]
[Tool
Name="VCManifestTool"
/]
[Tool
Name="VCXDCMakeTool"
/]
[Tool
Name="VCBscMakeTool"
/]
[Tool
Name="VCFxCopTool"
/]
[Tool
Name="VCAppVerifierTool"
/]
[Tool
Name="VCPostBuildEventTool"
/]
[/Configuration]
[Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="2"
CharacterSet="1"
WholeProgramOptimization="1"
]
[Tool
Name="VCPreBuildEventTool"
/]
[Tool
Name="VCCustomBuildTool"
/]
[Tool
Name="VCXMLDataGeneratorTool"
/]
[Tool
Name="VCWebServiceProxyGeneratorTool"
/]
[Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
ValidateParameters="true"
/]
[Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"
MinimalRebuild="false"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
/]
[Tool
Name="VCManagedResourceCompilerTool"
/]
[Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1036"
AdditionalIncludeDirectories="$(IntDir)"
/]
[Tool
Name="VCPreLinkEventTool"
/]
[Tool
Name="VCLinkerTool"
AdditionalDependencies="winmm.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/]
[Tool
Name="VCALinkTool"
/]
[Tool
Name="VCManifestTool"
/]
[Tool
Name="VCXDCMakeTool"
/]
[Tool
Name="VCBscMakeTool"
/]
[Tool
Name="VCFxCopTool"
/]
[Tool
Name="VCAppVerifierTool"
/]
[Tool
Name="VCPostBuildEventTool"
/]
[/Configuration]
[/Configurations]
[References]
[/References]
[Files]
[Filter
Name="Fichiers sources"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
]
[File
RelativePath=".\Buffer.cpp"
]
[/File]
[File
RelativePath=".\ChangeRes.cpp"
]
[/File]
[File
RelativePath=".\errorprint.cpp"
]
[/File]
[File
RelativePath=".\MainFrm.cpp"
]
[/File]
[File
RelativePath=".\Mot.cpp"
]
[/File]
[File
RelativePath=".\Pipe.cpp"
]
[/File]
[File
RelativePath=".\PtrFifo.cpp"
]
[/File]
[File
RelativePath=".\Reco.cpp"
]
[/File]
[File
RelativePath=".\SoundBase.cpp"
]
[/File]
[File
RelativePath=".\SoundFile.cpp"
]
[/File]
[File
RelativePath=".\SoundIn.cpp"
]
[/File]
[File
RelativePath=".\SoundOut.cpp"
]
[/File]
[File
RelativePath=".\stdafx.cpp"
]
[FileConfiguration
Name="Debug|Win32"
]
[Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/]
[/FileConfiguration]
[FileConfiguration
Name="Release|Win32"
]
[Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/]
[/FileConfiguration]
[/File]
[File
RelativePath=".\ttsmfc.cpp"
]
[/File]
[File
RelativePath=".\ttsmfcDoc.cpp"
]
[/File]
[File
RelativePath=".\ttsmfcView.cpp"
]
[/File]
[File
RelativePath=".\vegView.cpp"
]
[/File]
[/Filter]
[Filter
Name="Fichiers d'en-tête"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
]
[File
RelativePath=".\Buffer.h"
]
[/File]
[File
RelativePath=".\errorprint.h"
]
[/File]
[File
RelativePath=".\fister.h"
]
[/File]
[File
RelativePath=".\MainFrm.h"
]
[/File]
[File
RelativePath=".\Mot.h"
]
[/File]
[File
RelativePath=".\Pipe.h"
]
[/File]
[File
RelativePath=".\PtrFifo.h"
]
[/File]
[File
RelativePath=".\Reco.h"
]
[/File]
[File
RelativePath=".\Resource.h"
]
[/File]
[File
RelativePath=".\SoundBase.h"
]
[/File]
[File
RelativePath=".\SoundFile.h"
]
[/File]
[File
RelativePath=".\SoundIn.h"
]
[/File]
[File
RelativePath=".\SoundOut.h"
]
[/File]
[File
RelativePath=".\stdafx.h"
]
[/File]
[File
RelativePath=".\targetver.h"
]
[/File]
[File
RelativePath=".\ttsmfc.h"
]
[/File]
[File
RelativePath=".\ttsmfcDoc.h"
]
[/File]
[File
RelativePath=".\ttsmfcView.h"
]
[/File]
[File
RelativePath=".\type.h"
]
[/File]
[File
RelativePath=".\vegView.h"
]
[/File]
[/Filter]
[Filter
Name="Fichiers de ressources"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
]
[File
RelativePath=".\res\Toolbar.bmp"
]
[/File]
[File
RelativePath=".\res\ttsmfc.ico"
]
[/File]
[File
RelativePath=".\ttsmfc.rc"
]
[/File]
[File
RelativePath=".\res\ttsmfc.rc2"
]
[/File]
[File
RelativePath=".\res\ttsmfcDoc.ico"
]
[/File]
[/Filter]
[File
RelativePath=".\ReadMe.txt"
]
[/File]
[/Files]
[Globals]
[Global
Name="RESOURCE_FILE"
Value="ttsmfc.rc"
/]
[/Globals]
[/VisualStudioProject]