gcc cannot find -lgcc, g++.exe: error: CreateProcess: No such file or directory

gcc cannot find -lgcc, g++.exe: error: CreateProcess: No such file or directory

我正在尝试在 Windows 上使用 MingGW,但是当我尝试编译我的 c/c++ 文件时,当我使用 C(gcc)

编译时出现以下错误
> gcc c:\Users\Administrator\Desktop\C_C++\helloworld\hello.c - o c:\Users\Administrator\Desktop\C_C++\helloworld/hello

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lgcc_eh
collect2.exe: error: ld returned 1 exit status

用C++(g++)编译时出现如下错误

> g++ c:\Users\Administrator\Desktop\C_C++\helloworldcpp\hello.cpp -o c:\Users\Administrator\Desktop\C_C++\helloworldcpp/hello

g++.exe: error: CreateProcess: No such file or directory

路径变量是 C:\MinGW\bin 。我已经在基本安装包中下载了 mingw-developer-toolkit、mingw32-base、mingw32-gcc-g++ 和 msys-base。此外,我收到 iostream 的#include 错误。网上的方法几乎都试过了,还是没法解决。

似乎 MinGW 没有正确安装。

重新安装它可能会解决问题。