【问题标题】:Link error LNK1123 when using Microsoft Visual C++ 2010 Express使用 Microsoft Visual C++ 2010 Express 时出现链接错误 LNK1123
【发布时间】:2013-01-29 01:40:25
【问题描述】:

每次我尝试构建和调试简单的 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() 时,他们都会告诉我不要使用它或其他什么。救命!!!

【问题讨论】:

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-30
    • 1970-01-01
    • 2014-10-17
    • 1970-01-01
    相关资源
    最近更新 更多