通常我们编译工程按照debug和release区分,且明确在Debug版本的生成文件中加入d标记。譬如: HelloWorld.exe 一般是release的生成文件,而debug版叫:HelloWorldd.exe。

为了写非绝对名称(好像我们尽可能避免写绝对路径一样),我们使用宏来代替起到此作用。

改法1: 【属性界面】(存在问题)

1,【Configuration Properties】->【General】->【Target Name】 : HelloWorld  (若用项目名,则使用$(ProjectName)更好)

2, (debug配置下)【Linker】->【General】->【Output File】: $(OutDir)\$(TargetName)d.exe (在这里加的d)(这里的.exe也可以被其他宏去掉)

出现问题:

arning MSB8012: TargetPath(D:\xx\HelloWorld.exe) does not match the Linker's OutputFile property value (D:\xx\HelloWorldd.exe). 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).

改法2:(更好)

1, (debug配置下) 在【Target Name】内加后缀d,即:【Configuration Properties】->【General】->【Target Name】 : HelloWorldd  (或$(ProjectName)d)

2, 去掉【Output File】中的后缀d, 即:【Linker】->【General】->【Output File】: $(OutDir)\$(TargetName).exe

个人回顾:以前觉得这种内置配置的宏,只要能“拼接对”,怎么都行,现在才有动力想改掉这个一直以来的warning,惭愧。。而且,还没动力知道VS对这些宏的定义是如何规范的。

最新文章

  1. adobe premiere pro cc2015.0已停止工作 解决办法
  2. begin-end语句块在mysql中的使用问题
  3. Repeater分页代码
  4. NAT穿透解决方案介绍
  5. lua 操作中文字符串之截取和长度竖排显示
  6. java 获取项目绝对路径
  7. CLR via C#深解笔记三 - 基元类型、引用类型和值类型 | 类型和成员基础 | 常量和字段
  8. apache2: Could not reliably determine the server's fully qualified domain name
  9. 解决AD域认证问题—“未知的身份验证机制”
  10. 转载:在Ubuntu系统下装Win7并引导双系统
  11. FormSheet式模态视图,点击模态视图外隐藏模态视图的方法
  12. cpu性能探究 :cache line 原理
  13. java GUI简单记事本
  14. JAVA多线程高并发学习笔记(三)——Callable、Future和FutureTask
  15. 技术的极限(6): 密码朋克精神(Cypherpunk Spirit)
  16. mysql 8126
  17. 51nod-1459-迷宫游戏
  18. plupload 大文件分片上传与PHP分片合并探索
  19. 20155306白皎 《网络对抗》 Exp9 Web安全基础实践
  20. 关于UNITY学习,给新生建议

热门文章

  1. 启动tomcat时 错误: 代理抛出异常 : java.rmi.server.ExportException: Port already in use: 1099;
  2. linux------------Another app is currently holding the xtables lock. Perhaps you want to use the -w option?
  3. 【C#进阶】多播委托和委托数组像是一回事~
  4. CAS学习笔记(二)—— cas server端的login-webflow详细流程
  5. HTML5Canvas标签(https://developer.mozilla.org)
  6. My family No.1
  7. select/poll/epoll on serial port
  8. 【001:C# 中 get set 简写存在的陷阱】
  9. 用shell脚本监控进程是否存在 不存在则启动的实例
  10. iOS检测用户截屏并获取所截图片