gpt4 book ai didi

c++ - gcc 找不到-lgcc, g++.exe : error: CreateProcess: No such file or directory

转载 作者:行者123 更新时间:2023-12-04 15:54:56 27 4
gpt4 key购买 nike

我试图在 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 没有正确安装。

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

关于c++ - gcc 找不到-lgcc, g++.exe : error: CreateProcess: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52183515/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com