每次我尝试构建和调试简单的 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/