C++: LINK : debug\XXXXX.exe not found or not built by the last增量链接;执行完整链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1554984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C++: LINK : debug\XXXXX.exe not found or not built by the last incremental link; performing full link
提问by shoosh
Using visual studio 2008 SP1,
This line:
使用 Visual Studio 2008 SP1,
这一行:
LINK : debug\XXXXX.exe not found or not built by the last incremental link; performing full link
appears every single time I compile the project, no matter how small a change I make.
What could be the reasons for that?
每次编译项目时都会出现,无论我做了多么小的更改。
原因可能是什么?
采纳答案by shoosh
So it turns out that the problem fixes it self if I add /INCREMENTAL
to the linker command line. This in spite the fact that the default behavior according to the docs is to enable incremental linking.
所以事实证明,如果我添加/INCREMENTAL
到链接器命令行,问题就会自行解决。尽管事实上根据文档的默认行为是启用增量链接。
Strange.
奇怪的。
回答by Zura
Old question, but just in case for someone it is still an issue (and it is..).
老问题,但以防万一它仍然是一个问题(它是..)。
Incremental link is incompatible with generating manifest file (Proj opts > Linker > Manifest File > Generate Manifest: Yes). Indeed, generating manifest modifies exe/dll so linker has to do full linkage.
增量链接与生成清单文件不兼容(Proj opts > Linker > Manifest File > Generate Manifest:是)。实际上,生成清单会修改 exe/dll,因此链接器必须进行完整链接。
There are some workarounds, for more details: http://chadaustin.me/2009/05/incremental-linking-and-embedded-manifests/
有一些解决方法,更多细节:http: //chadaustin.me/2009/05/incremental-linking-and-embedded-manifests/
Temporary (and easiest/fastest) solution is to disable manifest generation during development and enable it again in the release stage. Although this disables XP/Vista-style gui for the app (controls look like in "classic mode").
临时(也是最简单/最快)的解决方案是在开发期间禁用清单生成并在发布阶段再次启用它。虽然这会禁用应用程序的 XP/Vista 风格的 gui(控件看起来像“经典模式”)。
回答by Xavier Nodet
Really shooting in the dark but,...
真的是在黑暗中拍摄,但是...
Do you move the XXXXX.exe from where it is built to somewhere else? The whole point of an incremental link is to change an existing exe. If there is none, it will be difficult...
您是否将 XXXXX.exe 从构建位置移动到其他位置?增量链接的全部意义在于更改现有的 exe。没有的话就很难了……
Another possible reason is that the file was changed after the build (probably by another tool)...
另一个可能的原因是文件在构建后被更改(可能是由另一个工具)...
All the reasons are listed in the help item for /INCREMENTAL:
所有原因都列在/INCREMENTAL 的帮助项中:
Additionally, LINK performs a full link if any of the following situations occur:
The incremental status (.ilk) file is missing. (LINK creates a new .ilk file in preparation for subsequent incremental linking.)
There is no write permission for the .ilk file. (LINK ignores the .ilk file and links nonincrementally.)
The .exe or .dll output file is missing.
The timestamp of the .ilk, .exe, or .dll is changed.
A LINK option is changed. Most LINK options, when changed between builds, cause a full link.
An object (.obj) file is added or omitted.
An object that was compiled with the /Yu /Z7 option is changed.
此外,如果发生以下任何一种情况,LINK 将执行完整链接:
增量状态 (.ilk) 文件丢失。(LINK 创建一个新的 .ilk 文件,为后续的增量链接做准备。)
.ilk 文件没有写权限。(LINK 忽略 .ilk 文件并以非增量方式链接。)
.exe 或 .dll 输出文件丢失。
.ilk、.exe 或 .dll 的时间戳已更改。
LINK 选项已更改。大多数 LINK 选项在构建之间更改时会导致完整链接。
添加或省略了对象 (.obj) 文件。
使用 /Yu /Z7 选项编译的对象已更改。
回答by Lou Franco
- Download procmonfrom Microsoft.
- Run it, set up a filter so that you are looking for accesses to the path that contains your .exe name.
- Do a link.
- See what trouble it's having -- does it find it, does it log an error on opening it. Procmon will log every single file open, read, close, etc. If it gets an error, it will log it.
- Also make sure it can find the .ilk file -- I think it needs that as well.
- 从 Microsoft下载procmon。
- 运行它,设置过滤器,以便您查找对包含 .exe 名称的路径的访问。
- 做个链接。
- 看看它有什么问题——它是否找到了它,它是否在打开它时记录了错误。Procmon 会记录每一个打开、读取、关闭等的文件。如果出现错误,它会记录下来。
- 还要确保它可以找到 .ilk 文件——我认为它也需要。
回答by MSalters
(ALso in the dark) One possible reason is that you use a project-wide header referencing the __DATE__
macro. But in that case, you'd see a full recompile as well (do you?)
(也在黑暗中)一个可能的原因是您使用了引用__DATE__
宏的项目范围的标题。但在这种情况下,您也会看到完整的重新编译(是吗?)
回答by Skyzboob
In my case, I have got this error yesterday.
就我而言,我昨天遇到了这个错误。
VS set code generation > runtime Library
to Multi-threaded Debug DLL (/MDd)
instead of Multi-threaded Debug (/MTd)
.
VS 设置code generation > runtime Library
为Multi-threaded Debug DLL (/MDd)
而不是Multi-threaded Debug (/MTd)
.
If i recreate new project this bad settings happens again. I manually switch to /Mtd
, then no error happens.
如果我重新创建新项目,这种错误的设置会再次发生。我手动切换到/Mtd
,然后没有错误发生。