如何在Visual Studio中设置$(OutDir),$(TargetName),$(TargetExt)和%(Lib.OutputFile)? [英] How to set $(OutDir), $(TargetName), $(TargetExt), and %(Lib.OutputFile) with Visual Studio?

查看:1325
本文介绍了如何在Visual Studio中设置$(OutDir),$(TargetName),$(TargetExt)和%(Lib.OutputFile)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Visual Studio 2010上构建 gtest .在转换解决方案文件之后,我尝试进行构建,并收到以下警告消息.

I'm trying to build gtest on Visual Studio 2010. After converting the solution file, I tried to build, and I got the following warning messages.

Warning 1   warning MSB8012: 
TargetPath(C:\Users\sucho\Desktop\gtest-1.5.0\msvc\gtest/Debug\gtest.lib) does not match
the Library's OutputFile property value (C:\Users\sucho\Desktop\gtest-1.5.0\msvc\gtest\
Debug\gtestd.lib).

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 %(Lib.OutputFile).  
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets

该消息说,我需要设置变量$(OutDir)$(TargetName)$(TargetExt),以及在%(Lib.OutputFile)中指定的属性值.

The message says I need to setup variables $(OutDir), $(TargetName) and $(TargetExt), together with property values specified in %(Lib.OutputFile).

如何使用Visual Studio(尤其是VS 2010)来做到这一点?

How can I do that with Visual Studio (especially VS 2010)?

推荐答案

警告是虚假的-假设您使用的是Google Test,那么效果很好

The warning is spurious -- assuming you're using Google Test, it works just fine

但是您可以使它消失.右键单击有问题的项目,然后选择属性.在左侧树视图中选择图书馆员",然后通过单击输出文件旁边的框并选择从父​​项或项目默认项继承"来更改右侧的输出文件"项.

You can make it go away however. Right click on the offending project and select properties. Select "Librarian" in the tree view on the left hand side, and change the "Output File" item on the right by clicking on the box next to output file, and selecting "Inherit from parent or project defaults".

这篇关于如何在Visual Studio中设置$(OutDir),$(TargetName),$(TargetExt)和%(Lib.OutputFile)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆