可执行文件未重建,但目标文件已重新编译

编程入门 行业动态 更新时间:2024-10-26 08:24:35
本文介绍了可执行文件未重建,但目标文件已重新编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用Visual Studio 2012构建基本的C ++项目.当我对源文件进行更改时:

Building a basic C++ project with Visual Studio 2012. When I make changes to source files:

  • 已编译相应的目标文件
  • 用于编译器的.tlog文件已更新
  • PDB文件已更新
  • 链接器的.tlog文件未更改
  • 链接器声明为All outputs are up-to-date.,并且不会生成新的可执行文件.
  • the corresponding object files are compiled
  • the .tlog files for the compiler are updated
  • the PDB file is updated
  • the .tlog files for the linker however are not changed
  • the linker claims All outputs are up-to-date. and does not build a new executable.

获取要生成的可执行文件的唯一方法是将其删除.跟踪系统似乎出了点问题,我想知道是否有人可以阐明这个问题.

The only way to get the executable to be built is deleting it. It seems something with the tracking system is wrong and I was wondering if anyone can shed some light on this issue.

这里是我更改两个文件,完整路径和其他一些内容后的msbuild输出(此输出用于VS2010工具集,但2012的行为相同):

Here is the msbuild output after I change two files, full paths and some other stuff omitted (this output is for the VS2010 toolset, but 2012 behaves the same):

1>Target "ClCompile" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets"... Using "CL" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0... Task "CL" Read Tracking Logs: cl.read.1.tlog CL.2520.read.1.tlog ... Outputs for .... XXX.OBJ YYY.OBJ ... xxx.cpp will be compiled as xxx.cpp was modified... yyy.cpp will be compiled as yyy.cpp was modified... Write Tracking Logs: cl.write.1.tlog CL.2520.write.1.tlog ... C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe .... Tracking command: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\Tracker.exe .... xxx.cpp yyy.cpp Done executing task "CL". 1>Done building target "ClCompile" in project "xxx.vcxproj".

到目前为止,太好了.现在链接器启动了(嗯,没有):

so far, so good. Now the linker kicks in (well, it doesn't):

1>Target "Link" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets".... Using "Link" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0... Task "Link" Using cached output dependency table built from: link.write.1.tlog Using cached input dependency table built from: ink.read.1.tlog Outputs for .... MY.EXE MY.PDB All outputs are up-to-date. Done executing task "Link". Task "Message" xxx.vcxproj -> my.exe Done executing task "Message". 1>Done building target "Link" in project "xxx.vcxproj".

推荐答案

在逐一检查属性表中的所有选项后,看来此问题的唯一来源是我们将中间目录设置为另一个驱动器上的目录.我们通常会在%TEMP%中进行源代码构建,大多数情况下,这些项目都位于另一个驱动器上.

After checking all options we have in the property sheets one-by-one, it seems the sole source of this problem is that we have the intermediate directory set to a directory on another drive. We always do out of source builds in %TEMP%, and most of the time the projects reside on another drive.

提交了错误报告此处,其中包含重现该问题的简单步骤.希望此问题能尽快解决.当前的解决方案是将IntDir设置为与项目在同一驱动器上的目录.

Filed a bug report here including simple steps that reproduce the problem. Hopefully this gets fixed soon. Current soltuion is to set IntDir to a direcyory on the same drive as the project.

更新

针对此问题提交的错误报告已按设计"关闭:似乎中间目录不应为%TEMP%或%TMP%或其中的任何子目录.令人不安,但至少我现在知道出了什么问题.

The bug report filed for this issue was closed as 'by design': it seems the Intermediate Directory should not be %TEMP% or %TMP% or any subdirectory of those. Disturbing, but at least I know what was wrong now.

更多推荐

可执行文件未重建,但目标文件已重新编译

本文发布于:2023-11-12 21:46:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可执行文件   目标   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!