与 C++ 编译文件相关的视觉错误

visual error related to c++ compile file

本文关键字:视觉 错误 C++ 编译 文件      更新时间:2023-10-16

当我尝试运行以下代码时

#include<iostream>
using namespace std;
 class Rectangle
 {
 public:
     int x,y;
     Rectangle(int a,int b)
     {
          x=a;
          y=b;
     }
      int area()
      {
           return x*y;
      }

 };

int main()
{
    Rectangle a(3,4);
    cout<<a.area()<<"  "<<endl;

     return 0;
}

我收到此错误

1>------ Build started: Project: project_class, Configuration: Debug Win32 ------
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 ==========

请帮助我澄清此错误的原因

看看这些:

http://support.microsoft.com/kb/2757355

转换为 COFF 期间失败:文件无效或损坏

错误"链接: 致命错误 LNK1123: 转换为 COFF 期间失败: 文件无效或损坏" 安装 Visual Studio 2012 发行预览版