c++ - 使用 Microsoft Visual C++ 2010 Express 时出现链接错误 LNK1123

标签 c++ visual-studio compiler-construction express

每次我尝试构建和调试简单的 Hello World 代码时,我都会收到如下错误信息:

1>------ Build started: Project: helloworld, Configuration: Debug Win32 ------
1>  test.cpp
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我正在使用这段代码:

#include <iostream>
using namespace std;
void main() {
cout << "Hello, World!" << endl;
}

而且我认为每当我使用 Main() 时,他们都会告诉我不要使用它或其他东西。帮助!!!

最佳答案

尝试将其设为 int main() 并确保将 return(0); 放在 main() block 的末尾.

关于c++ - 使用 Microsoft Visual C++ 2010 Express 时出现链接错误 LNK1123,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14574313/

相关文章:

java - 我的程序打印语句是错误的

c++ - 在 C/C++ 中覆盖符号

c++ - 如何正确重写 ASSERT 代码以在 msvc 中传递/分析?

Android 设备未显示为 Unity3d 调试的目标

尝试传递结构时 C++ 代码崩溃

c++ - 尝试添加处理程序以控制 MFC 窗体时 Visual Studio 崩溃

c# - 识别字符串并正确操作

java - 为一元非表达式生成 JVM 字节码

c++ - weak_ptr 是否与 unique_ptr 一起工作?

c++ - 多个可变参数模板函数