c++ - 链接器诊断 : "exe not found or not built by the last incremental link; performing full link", 为什么?

标签 c++ visual-studio-2010 visual-studio-2012

<分区>

刚刚下载了 Visual C++ 并输入了一个 hello world,它给了我错误:

LINK : c:\users\derek\documents\visual studio 2010\Projects\HelloWorld\Debug\HelloWorld.exe not found or not built by the last incremental link; performing full link

这是代码,它不会产生任何输出...

#include <iostream>
using namespace std;

int main() 
{
cout << "Hello World!";
system("PAUSE");
return 0; 
}

我做错了什么?

最佳答案

缺失的输出

std::cout 是缓冲的,这意味着它不会立即显示数据 - 即使您写入它。要解决应用程序可能不打印任何内容的问题,您应该在声明的输出后添加一个换行符,或者使用 std::endl 或等价物刷新它。

std::cout << "hello world" << std::endl; // new-line, and flush

诊断

您所指的诊断不是错误,而只是一条警告/信息性消息。

incremental linking有关,这是编译器用来解决每次编译应用程序时都必须重建涉及的每个源的问题的功能。如果链接器找不到以前编译的 exe,或者存在其他问题,它将发出声明的诊断,就好像在说; “我需要进行全面重建,抓紧时间”

更多内容可以阅读以下问答:


documentation 所述:

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.

如果我不想要增量链接和诊断怎么办?

如果您想禁用增量链接,您可以通过进入项目属性并删除 /INCREMENTAL 来实现。

查看文档:

关于c++ - 链接器诊断 : "exe not found or not built by the last incremental link; performing full link", 为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24195648/

相关文章:

c++ - 暂住地址

c++ - 内存要求 : N-point FFT (getting error)

c# - 如何将项目模板中的文件夹重命名为项目名称? (visual studio模板定制)

c# - 使用 FxCop 获得百分比代码覆盖率

wpf - Surface SDK 可以在 Visual Studio 2012 上运行吗?

visual-studio-2012 - 是什么导致多进程编译在Visual Studio 2012上失败?

c++ - 我如何用精神正确解析这个?

c++ - 在编译时通过用索引折叠指针来分配 C 数组

visual-studio - 在 Visual Studio 2010 中重新格式化 XML

c++ - Microsoft Visual C++ Redistributable for Visual Studio 2012 Update 4 Installer 中文显示