我正在尝试在Windows上使用MingGW,但是当我尝试用C(gcc)编译我的c/c++文件时,出现了以下错误:
> 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错误。我尝试了互联网上几乎所有的方法,但都无法解决。
g++.exe
是否存在于C:\MinGW\bin
目录中? - Alan Birtles