如何在Visual Studio 2010中使用项目的默认构建设置?

时间:2012-01-07 23:04:15

标签: visual-studio ide

我有一个Visual Studio 2007项目,我使用VS 2010成功升级。它说它成功构建,但是当项目的默认构建设置导致“构建成功”消息时,有2个警告声明:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): 
warning MSB8012: TargetPath(C:\MaxSDK-5.1.7\examples\plussz\.\..\..\sdk-build\plussz.dll) 
does not match the Linker's OutputFile property value (C:\MaxSDK-5.1.7\sdk-build\plussz.mxe). This      may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(991,5): warning MSB8012: TargetExt(.dll) does not match the Linker's OutputFile property value (.mxe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).

并且文件永远不会显示出来。此外,它尝试构建的文件有一个扩展名.DLL,但它应该有.mxo。

任何允许我构建此东西的东西都是一个很大的帮助,但我真正想做的是输出到项目文件夹(源代码所在的位置),而不是我的用户文件夹。我假设这个项目有一些预先存在的构建设置。是否有某种方式我可以使用那些而不是视觉工作室使用的全局变量?

1 个答案:

答案 0 :(得分:2)

我听起来像项目转换并不是那么成功。 VS2007?真的?

您应该可以通过更改项目属性来解决此问题。

在Visual Studio中,右键单击解决方案资源管理器中的项目,然后选择Properties 您可能需要在配置下拉菜单中选择All Configurations 点击配置属性部分中的General 将“输出目录”设置为:$(SolutionDir)$(配置)\
将“中间目录”设置为:$(配置)\
将“目标扩展”设置为:.mxo
在“Linker-> General”部分中:
将“输出文件”设置为:$(OutDir)$(TargetName)$(TargetExt)

希望这有帮助。