当前位置: 代码迷 >> 综合 >> i386 architecture of input file `D:/MinGW/lib/../lib/crt2.o' is incompatible with i386:x86-64 output
  详细解决方案

i386 architecture of input file `D:/MinGW/lib/../lib/crt2.o' is incompatible with i386:x86-64 output

热度:18   发布时间:2023-11-18 03:52:08.0

Dev C++报错编译空main函数报错如下:

D:\DEVc++\Dev-Cpp\MinGW64\x86_64-w64-mingw32\bin\ld.exe	i386 architecture of input file `D:/MinGW/lib/../lib/crt2.o' is incompatible with i386:x86-64 outputD:\DEVc++\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-crt_handler.o)	In function `__mingw_init_ehandler':87		C:\crossdev\src\mingw-w64-v3-git\mingw-w64-crt\crt\crt_handler.c	undefined reference to `__imp_RtlAddFunctionTable'[Error] ld returned 1 exit status

截图:

猜测原因是:本机以前装了MinGW,然后现在这个编译器用了之前的不兼容,但是我把本地也就会D盘的那个path环境变量都删了还是报错了。然后编译时地址还是出现了D:MinGW/lib 也就是之前装的。这点不知道为什么;

解决办法:

删掉提示的文件:i386 architecture of input file `D:/MinGW/lib/../lib/crt2.o' is incompatible with i386:x86-64 output中的crt2.0

编译成功了就。

这里删掉的还是以前安装的MinGW文件里的。!!而不是安装Dev C++ 自带的MinGW

  相关解决方案