然而,另一个MinGW的" GCC:错误:CreateProcess的:没有这样的文件或目录" [英] Yet Another MinGW "gcc: error: CreateProcess: No such file or directory"

查看:286
本文介绍了然而,另一个MinGW的" GCC:错误:CreateProcess的:没有这样的文件或目录"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过GUI安装程序安装MinGW的C编译器在Windows 8(64位)。
但是,当我尝试编译一个C程序,GCC说: GCC:CreateProcess的:没有这样的文件或目录

这是一个常见的​​错误,我都试过,我发现所有的解决方案,没有成功。

在具体地,(以下<一href=\"http://stackoverflow.com/questions/3848357/gcc-createprocess-no-such-file-or-directory\">CreateProcess:没有这样的文件或目录)我曾尝试:


  1. 将帖子添加 C:\\ MinGW的\\ libexec目录\\ GCC \\的mingw32 \\ 4.7.2 ,以我的系统路径

  2. 卸载,并通过MinGW的,得到CLI重新安装gcc:

    MinGW的,得到的mingw32删除-GCC结果
    MinGW的-get安装的mingw32-gcc的


其他建议?

编辑:gcc的详细输出:

 &GT; GCC -v helloWorld.c
使用内置的规格。
COLLECT_GCC = GCC
COLLECT_LTO_WRAPPER = C:/ MinGW的/ bin中/../的libexec / GCC / mingw32的/ 4.7.2 / lto-
wrapper.exe
目标:mingw32的
配置有:../gcc-4.7.2/configure --enable-语言= C,C ++,ADA,FORTRAN,OBJ
C,OBJ-C ++ --disable-sjlj的异常--with-DWARF2 --enable-共享--enable-libgo
熔点--disable-Win32的注册表--enable-libstdcxx调试--disable-集结poststage1-
与-CXX --enable-版本特有的运行时库--build =的mingw32 - preFIX = / MinGW的
线程模型:的Win32
gcc版本4.7.2(GCC)
COLLECT_GCC_OPTIONS =' - V''= -mtune i386的'-march = i386的'
cc1plus -quiet -v -i preFIX C:\\ MinGW的\\ BIN \\ LIB ../ / GCC / mingw32的/ 4.7.2 /
-quiet选项无法选项无法-dumpbase = -mtune i386的-march = i386的-auxbase选项 -
版本-o C:\\用户\\猫王\\应用程序数据\\本地的\\ Temp \\ cc4fWSvg.s
GCC:错误:CreateProcess的:没有这样的文件或目录


解决方案

您不应该添加 C:\\ MinGW的\\ libexec目录\\ GCC \\的mingw32 \\ 4.7.2 来路径。

地址: C:\\ MinGW的\\ BIN

您可能需要重新启动,以确保路径提供给适当的所有进程。

另一个建议是使用不同的MinGW的分布。它已经因为我用了一个官方MinGW的分布,因为安装步骤是如此错综复杂的,脆弱的很长一段时间。我听说他们已经取得了很大的进步来安装,但是从我听到什么似乎仍然是相当复杂和脆弱的。

TDM的安装程序只是工作,但我认为TDM版本是不太为4.7.2。

借助 nuwen分布的安装只是拆包你想要的东西的存档(我喜欢!),并确保路径指向gcc.exe的位置。 Nuwen还包Boost库,这是很好的。


我区分有帮助,这是我从 GCC -v的hello.c Ç得到:\\ mingw.4.7.2 \\ BIN 是path`):

 使用内置的规格。
COLLECT_GCC = GCC
COLLECT_LTO_WRAPPER = C:/mingw.4.7.2/bin /../的libexec / GCC / i686的-PC-的mingw32 / 4.7.2 / LTO-wrapper.exe
目标:为i686-PC-的mingw32
preFIX = / C /温度/ GCC /目标--with-GMP = / C /温度/ GCC / GMP --with-MPFR = / C /温度/ GCC - ../src/configure:与配置/ MPFR --with-MPC = / C /温度/ GCC / MPC --enable-语言= C,C ++ --with拱= i686的--with调整=通用--disable-libstdcxx-PCH --disable- NLS --disable共享--disable-sjlj的异常--disable-Win32的注册表--enable-检查=发行--enable-LTO
线程模型:的Win32
gcc版本4.7.2(GCC)
COLLECT_GCC_OPTIONS =' - V''= -mtune通用的''-march = i686的'
 C:/mingw.4.7.2/bin /../的libexec / GCC / i686的-PC-的mingw32 / 4.7.2 / cc1.exe -quiet -v -i preFIX C:\\ mingw.4.7.2 \\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.7.2 / hello.c的-quiet -dumpbase的hello.c -mtune =通用-march = i686的-auxbase你好-version -o C:\\用户\\ mikeb \\应用程序数据\\本地的\\ Temp \\ cct1oltc.s
GNU C(GCC)版本4.7.2(i686的-PC-的mingw32)
    由GNU C版本4.7.2,GMP版本5.0.5,MPFR 3.1.1版-P2,MPC版本1.0.1编译
GGC启发:--param GGC-分钟展开= 100 --param GGC-最小堆大小= 131072
忽略不存在的目录C:\\ mingw.4.7.2 \\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.7.2 /../../../../的i686-PC-mingw32的/包括
忽略重复目录C:/mingw.4.7.2/lib/gcc /../../的lib / GCC / i686的-PC-的mingw32 / 4.7.2 /包括
忽略不存在的目录C:/温度/ GCC /目标/包括
忽略不存在的目录/ C /温度/ GCC /目标/包括
忽略重复目录C:/mingw.4.7.2/lib/gcc /../../的lib / GCC / i686的-PC-的mingw32 / 4.7.2 /包括固定
忽略不存在的目录C:/mingw.4.7.2/lib/gcc /../../的lib / GCC / i686的-PC-的mingw32 / 4.7.2 /../../../../的i686 -pc-mingw32的/包括
忽略不存在的目录/ MinGW的/包括
的#include...的搜索从这里开始:
#包括LT&; ...&GT;搜索从这里开始:
 C:\\ mingw.4.7.2 \\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.7.2 /包括
 C:\\ mingw.4.7.2 \\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.7.2 /../../../../包括
 C:\\ mingw.4.7.2 \\ BIN \\ LIB ../ / GCC / i686的-PC-的mingw32 / 4.7.2 /包括,固定
搜索列表结束。
GNU C(GCC)版本4.7.2(i686的-PC-的mingw32)
    由GNU C版本4.7.2,GMP版本5.0.5,MPFR 3.1.1版-P2,MPC版本1.0.1编译
GGC启发:--param GGC-分钟展开= 100 --param GGC-最小堆大小= 131072
编译器可执行文件的校验:8461a53e6fc78ff58191bda61fe9586d
COLLECT_GCC_OPTIONS =' - V''= -mtune通用的''-march = i686的'
 作为-v -o C:\\用户\\ mikeb \\应用程序数据\\本地的\\ Temp \\ ccqRcYAj.o C:\\用户\\ mikeb \\应用程序数据\\本地的\\ Temp \\ cct1oltc.s
GNU汇编版本2.22(i686的-PC-的mingw32)使用BFD版(GNU Binutils的)2.22
COMPILER_PATH=c:/mingw.4.7.2/bin/../libexec/gcc/i686-pc-mingw32/4.7.2/;c:/mingw.4.7.2/bin/../libexec/gcc/
LIBRARY_PATH=c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/;c:/mingw.4.7.2/bin/../lib/gcc/;c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/../../../
COLLECT_GCC_OPTIONS =' - V''= -mtune通用的''-march = i686的'
 C:/mingw.4.7.2/bin /../的libexec / GCC / i686的-PC-的mingw32 / 4.7.2 / collect2.exe -Bdynamic C:/mingw.4.7.2/bin /../ LIB / GCC /i686-pc-mingw32/4.7.2/../../../crt2.oc:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/ crtbegin.o -Lc:/mingw.4.7.2/bin /../的lib / GCC / i686的-PC-的mingw32 / 4.7.2 -Lc:/mingw.4.7.2/bin /../ LIB / GCC - 立法会:/mingw.4.7.2/bin /../的lib / GCC / i686的-PC-的mingw32 / 4.7.2 /../../ .. C:\\用户\\ mikeb \\应用程序数据\\本地的\\ Temp \\ ccqRcYAj的.o -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt C:/mingw.4.7.2/bin /../的lib / GCC / i686- PC-的mingw32 / 4.7.2 / crtend.o

I have installed MinGW C compiler in Windows 8 (64 bit) through the GUI installer. But when I try to compile a C program, gcc says: gcc: CreateProcess: No such file or directory

It is a common bug, and I have tried all the solutions I found, without success.

In particular, (following CreateProcess: No such file or directory) I have tried to:

  1. [EDITED] Add C:\MinGw\libexec\gcc\mingw32\4.7.2 to my system PATH
  2. Uninstall and re-install gcc through mingw-get CLI:

    mingw-get remove mingw32-gcc
    mingw-get install mingw32-gcc

Other suggestions?

EDIT: verbose gcc output:

> gcc -v helloWorld.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.2/lto-
wrapper.exe
Target: mingw32
Configured with: ../gcc-4.7.2/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1-
with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=i386' '-march=i386'
cc1plus -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.7.2/
OPTIONS.C -quiet -dumpbase OPTIONS.C -mtune=i386 -march=i386 -auxbase OPTIONS -
version -o C:\Users\elvis\AppData\Local\Temp\cc4fWSvg.s
gcc: error: CreateProcess: No such file or directory

解决方案

You shouldn't add C:\MinGw\libexec\gcc\mingw32\4.7.2 to the path.

Add: c:\MinGW\bin

You may need to reboot to ensure that the path is made available to all processes properly.

Another suggestion is to use a different MinGW distribution. It's been a long time since I used an 'official' MinGW distribution because the installation steps were so byzantine and fragile. I've heard they've made large advances to the installer, but from what I hear it still seems to be rather complicated and fragile.

TDM's installer just works, but I think the TDM release isn't quite to 4.7.2.

The nuwen distribution's installation is just unpacking an archive where you want the thing (I love that!) and making sure the path points to the location of gcc.exe. Nuwen also packages the boost libraries, which is nice.


I case it helps, here's what I get from gcc -v hello.c (c:\mingw.4.7.2\bin is in the path`):

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw.4.7.2/bin/../libexec/gcc/i686-pc-mingw32/4.7.2/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/c/temp/gcc/dest --with-gmp=/c/temp/gcc/gmp --with-mpfr=/c/temp/gcc/mpfr --with-mpc=/c/temp/gcc/mpc --enable-languages=c,c++ --with-arch=i686 --with-tune=generic --disable-libstdcxx-pch --disable-nls --disable-shared --disable-sjlj-exceptions --disable-win32-registry --enable-checking=release --enable-lto
Thread model: win32
gcc version 4.7.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 c:/mingw.4.7.2/bin/../libexec/gcc/i686-pc-mingw32/4.7.2/cc1.exe -quiet -v -iprefix c:\mingw.4.7.2\bin\../lib/gcc/i686-pc-mingw32/4.7.2/ hello.c -quiet -dumpbase hello.c -mtune=generic -march=i686 -auxbase hello -version -o C:\Users\mikeb\AppData\Local\Temp\cct1oltc.s
GNU C (GCC) version 4.7.2 (i686-pc-mingw32)
    compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "c:\mingw.4.7.2\bin\../lib/gcc/i686-pc-mingw32/4.7.2/../../../../i686-pc-mingw32/include"
ignoring duplicate directory "c:/mingw.4.7.2/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.7.2/include"
ignoring nonexistent directory "c:/temp/gcc/dest/include"
ignoring nonexistent directory "/c/temp/gcc/dest/include"
ignoring duplicate directory "c:/mingw.4.7.2/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.7.2/include-fixed"
ignoring nonexistent directory "c:/mingw.4.7.2/lib/gcc/../../lib/gcc/i686-pc-mingw32/4.7.2/../../../../i686-pc-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\mingw.4.7.2\bin\../lib/gcc/i686-pc-mingw32/4.7.2/include
 c:\mingw.4.7.2\bin\../lib/gcc/i686-pc-mingw32/4.7.2/../../../../include
 c:\mingw.4.7.2\bin\../lib/gcc/i686-pc-mingw32/4.7.2/include-fixed
End of search list.
GNU C (GCC) version 4.7.2 (i686-pc-mingw32)
    compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1-p2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8461a53e6fc78ff58191bda61fe9586d
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 as -v -o C:\Users\mikeb\AppData\Local\Temp\ccqRcYAj.o C:\Users\mikeb\AppData\Local\Temp\cct1oltc.s
GNU assembler version 2.22 (i686-pc-mingw32) using BFD version (GNU Binutils) 2.22
COMPILER_PATH=c:/mingw.4.7.2/bin/../libexec/gcc/i686-pc-mingw32/4.7.2/;c:/mingw.4.7.2/bin/../libexec/gcc/
LIBRARY_PATH=c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/;c:/mingw.4.7.2/bin/../lib/gcc/;c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/../../../
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
 c:/mingw.4.7.2/bin/../libexec/gcc/i686-pc-mingw32/4.7.2/collect2.exe -Bdynamic c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/../../../crt2.o c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/crtbegin.o -Lc:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2 -Lc:/mingw.4.7.2/bin/../lib/gcc -Lc:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/../../.. C:\Users\mikeb\AppData\Local\Temp\ccqRcYAj.o -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw.4.7.2/bin/../lib/gcc/i686-pc-mingw32/4.7.2/crtend.o

这篇关于然而,另一个MinGW的&QUOT; GCC:错误:CreateProcess的:没有这样的文件或目录&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆