【问题标题】:build does not stop in Visual Studio 2010在 Visual Studio 2010 中构建不会停止
【发布时间】:2015-03-22 13:58:31
【问题描述】:

我尝试在 Visual Studio 中构建一段简单的代码,但构建过程陷入了无限循环。

代码很简单:

// test.cpp : Defines the entry point for the console application.
//

#include <iostream.h>

using namespace std;

int main(void)
{
    cout << "Hi." << endl;
    return 0;
}

知道发生了什么吗?

谢谢。

【问题讨论】:

  • 您的stdafx.h 中有什么内容?在构建过程中的哪个阶段它会卡住?预处理、编译或链接?
  • 我现在让代码变得更简单了。它不工作....
  • 好的,所以我重写了简单的代码示例。如何找到我们的代码卡在哪个阶段?
  • stdafx.h 是一些愚蠢的预编译,VS 在创建新项目时不断推动您添加。我以前见过它造成麻烦。

标签: c++ visual-studio-2010 build projects-and-solutions


【解决方案1】:

发现几件事:

  1. 不确定“stdafx.h”中有什么
  2. #include
  3. std::cout、std::endl(除非在某处使用命名空间 std;)

不过,构建对我来说效果很好。

【讨论】:

  • 我确实忘记了命名空间——我更正了这个例子。但不能正常工作。
猜你喜欢
  • 1970-01-01
  • 2011-07-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-16
  • 1970-01-01
  • 2018-08-31
相关资源
最近更新 更多