在Visual Studio中指定输出文件的良好做法

Visual Studio中有两处可以指定输出文件,为什么要这样呢?明明生成的输出文件只有唯一确定的一个!万一两处指定的不一致,就不会产生二义性吗?还好,linker中的那个设置会优先覆盖另一个。这里给出了一种十全十美的做法。


复制的3ds max sdk中的原文:


3ds Max SDK Programmer's Guide > Writing Plug-ins > Creating a Plug-in Project > Manually Creating a New Plug-in Project >  Specifying the Output File


You now need to specify the output file name. The output file path consists of three parts: the directory path, the filename and the extension. Starting with Visual Studio 2010, the file path specified in the Linker > General > Output Directory property needs to match the paths specified under Configuration > General. That means the directory portion of the output path must match the Configuration > General > Output Directory property. Also the filename portion of the output path must match the Configuration > General > Target Name property. And the file extension part of the output path must match the Configuration > General >Target Extension property. If the paths do not match, the compiler will emit a long verbose warning. Therefore the easiest and best way to specify the output path is to specify the three separate elements of the output path under Configuration > General. For example:

  1. Open the Project Property Pages dialog (e.g. from the menu under Project > Properties ...)
  2. Choose All Configurations from the Configuration: drop-down list at the top of the dialog.
  3. From the tree-control in the left pane choose the Configuration Properties > General folder.
  4. For the Output Directory property, specify the path to where you want the file to be built.
  5. For the Intermediate Directory property, It is usually best to specify obj\$(Platform)\$(Configuration). That way the intermediate files for different build configurations do not overwrite each other. This will also allow you to quickly and easily delete any intermdiate files after the build is cleaned up.
  6. For the Target Name property specify the name of the file.
  7. For the Target Extension property specify the file extension of the file.
  8. From the tree-control in the left pane chose the Linker > General folder.
  9. For the Output File property specify $(OutDir)$(TargetName)$(TargetExt). This will take the values you entered in earlier and combine them to form the output path.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值