Меню

Gcc ошибка createprocess no such file or directory

I had a very long path, and there’s a file in there somewhere (not gcc.exe) but another file, that gcc.exe is accessing from the path..

So when I cleared the path, it worked

C:MinGW>cd bin


C:MinGWbin>where gcc.exe
C:MinGWbingcc.exe
C:Perl64sitebingcc.exe

^^ So running gcc from there will definitely run the ming gcc.exe

C:MinGWbin>type file6.c
#include<stdio.h>
void main()
{
int num1,num2;
scanf("%2d %4d",&num1,&num2);
printf("a=%d b=%d",num1,num2);
scanf("%d",&num1);
//flushall();
printf("c=%d",num1);
}

Compiling it I got this error

C:MinGWbin>gcc file6.c
gcc: error: CreateProcess: No such file or directory

My PATH was huge

C:MinGWbin>path
PATH=C:Windowssystem32;C:Windows;C:Windowssystem32wbem;C:P......

C:MinGWbin>path | grep -io «ming»

It didn’t have ming there.

C:MinGWbin>echo MING | grep -io «ming»
MING

(and yeah that grep works..the path didn’t have ming there)

Clearing my path completely, led it to work!

C:MinGWbin>set PATH=

C:MinGWbin>gcc file6.c

C:MinGWbin>

So, it’s not clear yet precisely what it was in the PATH that led to the clash. What directory, what file.

Update-

The above seems to be correct to me but to add, it’s also not a simple case of something earlier in the path clashing.. because normally the current directory takes precedence. And it does here in so far as gcc —version shows it’s running the ming one and not one of the ones in a conflicting directory. So there’s something funny going on that, if the conflicting directory is in the path) , one has to either do .gcc or add . to the start of the path or add c:MinGWbin before any conflicting directories in the path. this is the case even when you’re in C:MinGWbin and that’s strange. And when it gives an error, it is still running Ming’s gcc but (For some reason) looking at the conflicting directory too, as I see from process monitor. There may be more of an answer here http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista in the link mentioned in the very upvoted answer here

That’s Ming32 bit..

Looking at Ming 64bit, probably has te same issue, but I see, interestingly, it comes with a bat file that (sensibly) actually puts the bin directory at the tart of the path. And it looks like that is a standard way of running Ming gcc properly.

The code::blocks IDE (sensibly) also puts the bin directory at the start of the path. If you run a C program that shows environment variables then you see that.

I had a very long path, and there’s a file in there somewhere (not gcc.exe) but another file, that gcc.exe is accessing from the path..

So when I cleared the path, it worked

C:MinGW>cd bin


C:MinGWbin>where gcc.exe
C:MinGWbingcc.exe
C:Perl64sitebingcc.exe

^^ So running gcc from there will definitely run the ming gcc.exe

C:MinGWbin>type file6.c
#include<stdio.h>
void main()
{
int num1,num2;
scanf("%2d %4d",&num1,&num2);
printf("a=%d b=%d",num1,num2);
scanf("%d",&num1);
//flushall();
printf("c=%d",num1);
}

Compiling it I got this error

C:MinGWbin>gcc file6.c
gcc: error: CreateProcess: No such file or directory

My PATH was huge

C:MinGWbin>path
PATH=C:Windowssystem32;C:Windows;C:Windowssystem32wbem;C:P......

C:MinGWbin>path | grep -io «ming»

It didn’t have ming there.

C:MinGWbin>echo MING | grep -io «ming»
MING

(and yeah that grep works..the path didn’t have ming there)

Clearing my path completely, led it to work!

C:MinGWbin>set PATH=

C:MinGWbin>gcc file6.c

C:MinGWbin>

So, it’s not clear yet precisely what it was in the PATH that led to the clash. What directory, what file.

Update-

The above seems to be correct to me but to add, it’s also not a simple case of something earlier in the path clashing.. because normally the current directory takes precedence. And it does here in so far as gcc —version shows it’s running the ming one and not one of the ones in a conflicting directory. So there’s something funny going on that, if the conflicting directory is in the path) , one has to either do .gcc or add . to the start of the path or add c:MinGWbin before any conflicting directories in the path. this is the case even when you’re in C:MinGWbin and that’s strange. And when it gives an error, it is still running Ming’s gcc but (For some reason) looking at the conflicting directory too, as I see from process monitor. There may be more of an answer here http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista in the link mentioned in the very upvoted answer here

That’s Ming32 bit..

Looking at Ming 64bit, probably has te same issue, but I see, interestingly, it comes with a bat file that (sensibly) actually puts the bin directory at the tart of the path. And it looks like that is a standard way of running Ming gcc properly.

The code::blocks IDE (sensibly) also puts the bin directory at the start of the path. If you run a C program that shows environment variables then you see that.

I had a very long path, and there’s a file in there somewhere (not gcc.exe) but another file, that gcc.exe is accessing from the path..

So when I cleared the path, it worked

C:MinGW>cd bin


C:MinGWbin>where gcc.exe
C:MinGWbingcc.exe
C:Perl64sitebingcc.exe

^^ So running gcc from there will definitely run the ming gcc.exe

C:MinGWbin>type file6.c
#include<stdio.h>
void main()
{
int num1,num2;
scanf("%2d %4d",&num1,&num2);
printf("a=%d b=%d",num1,num2);
scanf("%d",&num1);
//flushall();
printf("c=%d",num1);
}

Compiling it I got this error

C:MinGWbin>gcc file6.c
gcc: error: CreateProcess: No such file or directory

My PATH was huge

C:MinGWbin>path
PATH=C:Windowssystem32;C:Windows;C:Windowssystem32wbem;C:P......

C:MinGWbin>path | grep -io «ming»

It didn’t have ming there.

C:MinGWbin>echo MING | grep -io «ming»
MING

(and yeah that grep works..the path didn’t have ming there)

Clearing my path completely, led it to work!

C:MinGWbin>set PATH=

C:MinGWbin>gcc file6.c

C:MinGWbin>

So, it’s not clear yet precisely what it was in the PATH that led to the clash. What directory, what file.

Update-

The above seems to be correct to me but to add, it’s also not a simple case of something earlier in the path clashing.. because normally the current directory takes precedence. And it does here in so far as gcc —version shows it’s running the ming one and not one of the ones in a conflicting directory. So there’s something funny going on that, if the conflicting directory is in the path) , one has to either do .gcc or add . to the start of the path or add c:MinGWbin before any conflicting directories in the path. this is the case even when you’re in C:MinGWbin and that’s strange. And when it gives an error, it is still running Ming’s gcc but (For some reason) looking at the conflicting directory too, as I see from process monitor. There may be more of an answer here http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista in the link mentioned in the very upvoted answer here

That’s Ming32 bit..

Looking at Ming 64bit, probably has te same issue, but I see, interestingly, it comes with a bat file that (sensibly) actually puts the bin directory at the tart of the path. And it looks like that is a standard way of running Ming gcc properly.

The code::blocks IDE (sensibly) also puts the bin directory at the start of the path. If you run a C program that shows environment variables then you see that.

Since last August, I have compiled the latest emacs about once a month. Last time was on 24 March, and it worked as expected. Today, .configure puked with the message that gcc couldn’t compile an executable.

I’m now in the state of can’t use, can’t upgrade, can’t remove & reinstall gcc. How does this happen? Is there a way to fix this, short of a complete reinstallation of MSYS? My most common usage is running git in bash, because the windows version causes issues with some things I work on. AFAIK, I haven’t done anything to the system itself in the past month. I certainly haven’t moved around any of the gcc files.

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ gcc --version
gcc.exe (Rev3, Built by MSYS2 project) 11.2.0

The error:

micha@OPTI-9010-WIN10` MINGW64 /c/Emacs/emacs-src/lib
$ gcc nansleep.c
gcc.exe: fatal error: cannot execute 'cc1': CreateProcess: No such file or directory
compilation terminated.

App upgrade:

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ pacman -S mingw-w64-x86_64-gcc
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing mingw-w64-x86_64-gcc (11.3.0-1) breaks dependency 'mingw-w64-x86_64-gcc=11.2.0-3' required by mingw-w64-x86_64-gcc-objc
:: installing mingw-w64-x86_64-gcc (11.3.0-1) breaks dependency 'mingw-w64-x86_64-gcc=11.2.0-3' required by mingw-w64-x86_64-libgccjit

Through the looking glass:

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ pacman -S mingw-w64-x86_64-gcc-objc
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing mingw-w64-x86_64-gcc (11.3.0-1) breaks dependency 'mingw-w64-x86_64-gcc=11.2.0-3' required by mingw-w64-x86_64-libgccjit

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ pacman -S mingw-w64-x86_64-libgccjit
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: installing mingw-w64-x86_64-gcc (11.3.0-1) breaks dependency 'mingw-w64-x86_64-gcc=11.2.0-3' required by mingw-w64-x86_64-gcc-objc

Files:

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ gcc -print-search-dirs
install: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/
programs: =C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/11.2.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/
libraries: =C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/11.2.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../x86_64-w64-mingw32/11.2.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/;D:/a/msys64/mingw64/x86_64-w64-mingw32/lib/x86_64-w64-mingw32/11.2.0/;D:/a/msys64/mingw64/x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../;D:/a/msys64/mingw64/x86_64-w64-mingw32/lib/

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ locate cc1
/mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1.exe
/mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1obj.exe
/mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1objplus.exe
/mingw64/lib/gcc/x86_64-w64-mingw32/11.2.0/cc1plus.exe

System upgrade:

micha@OPTI-9010-WIN10 MINGW64 /c/Emacs/emacs-src/lib
$ pacman -Syu
:: Synchronizing package databases...
[ ... ]
:: Starting full system upgrade...
:: Replace autoconf with msys/autoconf-wrapper? [Y/n]
:: Replace mingw-w64-x86_64-libtool with mingw64/mingw-w64-x86_64-libltdl? [Y/n]
[ ... ]
Total Download Size:    261.78 MiB
Total Installed Size:  1674.59 MiB
Net Upgrade Size:       -41.30 MiB
[ ... ]
error: failed to commit transaction (conflicting files)
mingw-w64-x86_64-emacs: /mingw64/share/applications/emacs-mail.desktop exists in filesystem
mingw-w64-x86_64-emacs: /mingw64/share/applications/emacsclient.exe-mail.desktop exists in filesystem
mingw-w64-x86_64-emacs: /mingw64/share/applications/emacsclient.exe.desktop exists in filesystem
mingw-w64-x86_64-emacs: /mingw64/share/metainfo/emacs.metainfo.xml exists in filesystem
Errors occurred, no packages were upgraded.

What? What can the existence of these files possibly have to do with upgrading system files? Why would I expect them to not be there, if I’m doing an upgrade?

Environment:

Device name OPTI-9010-WIN10
Processor Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz 3.40 GHz
Installed RAM 20.0 GB (19.9 GB usable)
System type 64-bit operating system, x64-based processor

Edition Windows 10 Pro
Version 21H2
Installed on ‎9/‎4/‎2021
OS build 19044.1645

Thanks.

mp

Я получаю эту ошибку всякий раз, когда я пытаюсь запустить GCC вне его каталога установки (E:MinGWbin).

Итак, допустим я в E:code и иметь файл с именем one.c. Бегущий:
gcc one.c -o one.exe даст мне эту ошибку:

gcc: CreateProcess: No such file or directory

единственным обходным путем является переход в каталог установки, запуск gcc оттуда и указание всех других путей. Моя переменная окружающей среды Path содержит E:MinGWbin.

любые предложения по устранению этой проблемы? Я запуск Windows XP SP3.

24 ответов


его специально сказали, что вам нужно перезагрузиться после установки переменных среды в windows для migwin.


У меня была аналогичная проблема, вызванная не установкой компилятора C++. В моем случае я собирал .cpp-файлы для расширения Python, но компилятор сначала вызывается как c:mingwbingcc — … исполняемый.

внутренне, gcc.exe заметит, что его попросили скомпилировать .файл cpp. Он попытается вызвать g++.exe и сбой с тем же сообщением об ошибке:

gcc.exe: CreateProcess: нет такого файла или каталога


по данным код:: блоки wiki, вам необходимо добавить C:MinGWlibexecgccmingw32MinGW-Version на PATH. Нет необходимости перезапускать, но вам нужно открыть другой терминал, чтобы получить новейший PATH настройки.

для MinGW-w64 это <mingw install directory>libexecgccx86_64-w64-mingw32.7.0

27

автор: Herberth Amaral


У меня просто была эта проблема.

в моем случае проблема была связана с проблемами при загрузке пакетов для GCC. Программа mingw-get думала, что закончила загрузку, но это не так.

Я хотел обновить GCC, поэтому я использовал mingw-get, чтобы получить более новую версию. По какой-то причине mingw-get думал, что загрузка для определенного файла закончена, но это не так. Когда он пошел, чтобы извлечь файл, я думаю, он выдал ошибку (которую я даже не потрудился посмотреть-я просто запустите «mingw-get update && mingw-get install mingw32-gcc» и оставьте его там).

чтобы решить, я удалил gcc, выполнив «mingw-get remove mingw32-gcc» , а также удалил файл пакета (тот, который mingw-get не полностью загрузил), который был в папке кэша mingw («C:MinGWvarcachemingw-getpackages» в моей системе), затем снова запустил команду install. Он загрузил и установил недостающие части GCC (он не полностью загрузил пакет GCC-core).

Что решена моя проблема.

интересно, что mingw-get был достаточно умен, чтобы продолжить загрузку GCC-core даже после того, как я удалил файл пакета в папке кэша, а также удалил пакет mingw32-gcc.

Я думаю, что более фундаментальной проблемой было то, что, поскольку файлы GCC-core не были установлены, cc1 не было. И gcc использует cc1. Я предполагаю, что, когда gcc попытался запустить cc1, он использовал CreateProcess где-то, проходя путь cc1, который не был путем существующий файл. Таким образом, сообщение об ошибке.

8

автор: Pedro Henrique A. Oliveira


у меня была точно такая же проблема.

после перепроверки моего PATH, Я понял, что установил оба Mingw (64 bit) и Cygwin (32 бит).
Проблема в том, что оба Mingw и Cygwin есть g++.

отключив пути Cygwin, ошибка исчезла.


Итак, это глупое сообщение об ошибке, потому что оно не говорит вам что файл, который он не может найти.

выполните команду еще раз с подробным флагом gcc -v чтобы увидеть, что gcc до.

в моем случае случилось так, что он пытался позвонить cc1plus. Я проверил, у меня его нет. Установил компилятор mingw на C++, а затем сделал.


получал то же сообщение об ошибке при попытке запуска из Cygwin со ссылками на установку mingw.

используя ту же установку mingw32-make-3.80.0-3.exe от http://www.mingw.org/wiki/FAQ и опция оболочки mingw из Start — > Programs — > на WinXP SP3 и gcc работает нормально.


эта проблема заключается в том, что вы используете материал суффикса верхнего регистра.C вместо строчных букв.c при компиляции с помощью Mingw GCC. Например, когда вам это нравится:

gcc -o stuff stuff.C

затем вы получите сообщение: gcc: CreateProcess: No such file or directory

но если вы это сделаете:

 gcc -o stuff stuff.c

затем он работает. Я просто не знаю, почему.


У меня была такая же проблема, и ни одно из предложенных исправлений не работало для меня. Поэтому, хотя это старый поток, я думаю, что я мог бы также опубликовать свое решение, если кто-то еще найдет этот поток через Google(как и я).

для меня мне пришлось удалить MinGW / удалить папку MinGW и переустановить. После повторной установки он работает как шарм.


Я испытал аналогичную проблему. Первоначально добавление папки bin GCC в мой системный путь не решило проблему. Я нашел два решения.

первым было запустить пакетный файл, который я нашел в корне установки MinGW, mingwbuilds.летучая мышь. Он (по-видимому) запускает командную строку, настроенную правильно для запуска GCC. Во-вторых, удалить двойные кавычки из папки GCC install bin, которую я добавил в переменную пути пользователя. Я попробовал это после того, как заметил партию файл не использует двойные кавычки вокруг пути установки bin.

Дополнительные Детали

Я случайно нашел пакетный файл во время просмотра дерева папок установки, пытаясь найти различные исполняемые файлы, которые не запускались (в соответствии с выходом-v). Я нашел некоторую информацию о MinGW wiki,http://www.mingw.org/wiki/Getting_Started, в разделах предостережения и параметры среды, это указывает, почему установщик MinGW не настраивает систему или путь пользователя для включения папки установки. Они, похоже, подтверждают, что пакетный файл предназначен для запуска командной строки, подходящей для запуска GCC из командной строки Windows.


в «дайте человеку рыбу, накормите его на день; научите человека рыбачить, избавьтесь от него на весь уик-энд» Вена,

g++ --help

показывает параметры компилятора. Опция g++ — v помогает:

  -v                       Display the programs invoked by the compiler

просмотрите выходные данные для фиктивных путей. В моем случае исходная команда:

g++ -v "d:/UW_Work/EasyUnit/examples/1-BasicUnitTesting/main.cpp"

сгенерированный выход, включая этот маленький драгоценный камень:

-iprefix c:olimexodsyagartoarm-none-eabibin../lib/gcc/arm-none-eabi/4.5.1/

что объясняет сообщение «Нет такого файла или каталога».

в «../lib/gcc/arm-none-eabi/ 4.5.1 / » сегмент исходит из встроенных спецификаций:

g++ -dumpspecs

у меня был очень длинный путь, и где-то там есть файл (не gcc.exe) но другой файл, этот gcc.exe получает доступ из пути..

поэтому, когда я очистил путь, он работал

C:MinGW>cd bin


C:MinGWbin>where gcc.exe
C:MinGWbingcc.exe
C:Perl64sitebingcc.exe

^^ таким образом, запуск gcc оттуда определенно запустит gcc ming.exe

C:MinGWbin>type file6.c
#include<stdio.h>
void main()
{
int num1,num2;
scanf("%2d %4d",&num1,&num2);
printf("a=%d b=%d",num1,num2);
scanf("%d",&num1);
//flushall();
printf("c=%d",num1);
}

компиляция я получил эту ошибку

C:MinGWbin>gcc file6.c
gcc: error: CreateProcess: No such file or directory

мой путь был огромен

C:MinGWbin>path
PATH=C:Windowssystem32;C:Windows;C:Windowssystem32wbem;C:P......

C:MinGWbin > путь / grep-io «ming»

у него не было мин там.

C:MinGWbin > Эхо мин / grep-io » мин»
Минг!—9—>

(и да, что grep работает..путь не есть мин есть)

очистка моего пути полностью, привел его к работе!

C:MinGWbin>set PATH=

C:MinGWbin>gcc file6.c

C:MinGWbin>

Итак, пока не ясно, что именно было на пути, который привел к столкновению. Какой каталог, какой файл.

обновление-

выше, кажется, правильно для меня, но добавить, это также не простой случай чего-то ранее на пути столкнулись.. потому что обычно текущий каталог имеет приоритет. И это происходит здесь, поскольку GCC — version показывает, что он запускает ming, а не один из них в конфликтующем каталоге. Так что есть что-то забавное, если конфликтующий каталог находится в пути) , нужно либо сделать .gcc или добавить . к началу пути или добавить c:MinGWbin перед любыми конфликтующими каталогами в пути. это так, даже когда вы находитесь в C:MinGWbin и вот странный. И когда он дает ошибку, он все еще работает gcc Ming, но (по какой-то причине) смотрит на конфликтующий каталог, как я вижу из process monitor. Здесь может быть больше ответа http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista в ссылке, упомянутой в самом ответе здесь

это бит Ming32..

глядя на Ming 64bit, вероятно, имеет ту же проблему, но я вижу, интересно, что он поставляется с bat-файл, который (разумно) фактически помещает каталог bin в терпкий путь. И похоже, что это стандартный способ правильной работы Ming gcc.

Code::blocks IDE (разумно) также помещает каталог bin в начале пути. Если вы запустите программу C, которая показывает переменные среды, вы увидите это.


у меня была та же проблема, но ни одно из перечисленных в настоящее время решений не помогло сначала попробовать.

-v опция не дала никаких дополнительных подсказок.

пришлось прибегнуть к procmon и чтобы иметь возможность найти корень проблемы.

сброс g++ активность файла процесса выявила многочисленные попытки найти cc1plus исполняемый файл по разным путям. Среди них были пути к старой версии GCC.

но эта старая версия жила отдельно папка и вообще не упоминалась из новой версии, которую я пытался запустить.

наконец, устаревший путь был найден в переменной среды system %PATH%.
После его удаления, новая версия работает без ошибок.


добавить E:MinGWbin до PATH переменной.


похоже, что есть несколько дистрибутивов выпуска для MinGW. Какой вам попробовать? Для записи я столкнулся с той же проблемой, что и OP, и дистрибутив, который я получил, был от TDM-GCC 4.5.1.

Я нашел дистрибутив MinGW здесь кажется, работает намного лучше и настраивает все правильно. Поэтому для тех, кто сталкивается с этой задержанной ошибкой «createprocess-no-such-file-or-directory» и не может заставить вещи работать, удалите существующий MinGW и попробуйте тот, который я связал вместо.


У меня была такая же проблема (я запускаю cygwin)

запуск оболочки через cygwin.летучая мышь не помог, но запуск снаряда через Мингшелл помог. Не совсем уверен, почему, но я думаю, что это связано с дополнительным слоем, который cygwin помещает между исполняющим скриптом и базовой файловой системой.

я запускал pip install из Cygwin виртуального env для установки Django sentry..


решение для меня-это просто:

  1. когда вы сохраняете программу, скажем, ее имя привет.cpp положите его в папку, например,xxl сохраните вашу программу.

  2. вырезать эту папку и поместить ее в папку bin mingw.

  3. при вызове программы:

    ------ g++ xxlhi.cpp --------
    

эта проблема может возникнуть, если у вас есть разные версии программ.

например, у вас есть 1-летний gcc и вы хотите скомпилировать исходный код на C++. Если вы используете mingw-get установка g++, gcc и g++ внезапно будут разные версии, и вы, вероятно, окажетесь в этой ситуации.

под управлением mingw-get update и mingw-get upgrade решил этот вопрос для меня.


(ссылаясь на оригинальную проблему)
Сегодняшняя версия mingw (см. дату поста)
Все, что мне нужно было сделать, это установить путь в той же оболочке, в которой я бежал gcc.
Мне потребовался час, чтобы вспомнить, как установить DOS variables

A:> set PATH=C:MinGWbin;
C:Program FilesImageMagick-6.8.0-Q16;
C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;
C:WINDOWSsystem32WindowsPowerShellv1.0;
C:Program FilesQuickTimeQTSystem
A:> gcc hi.c

У меня была такая же проблема, и я пробовал все без результата, что исправило проблему для меня, это изменение порядка путей библиотеки в переменной PATH. У меня был cygwin, а также некоторые другие компиляторы, поэтому между ними, вероятно, было какое-то столкновение. Что я сделал, так это положил C:MinGWbin; путь сначала перед всеми другими путями, и это исправило проблему для меня!


попробуйте поместить путь в системные переменные вместо ввода пользовательских переменных в переменные среды.


я получал это сообщение об ошибке, потому что я использовал MinGW-w64 и команды в <install path>bin У всех был странный префикс. Я попытался вызвать исполняемые файлы в каталогах «целевой псевдоним», а не в <install path>bin каталоги, что привело к еще большим проблемам. Это нет-нет согласно часто задаваемые вопросы. Тогда решение для меня заключалось в создании символических ссылок на все команды с префиксами. Я открыл командную строку с повышенными правами и использовал что-то вроде mklink gcc.exe x86_64-w64-mingw32-gcc.exe для каждого исполняемого, и теперь моя сборка работает.


хотя сообщение старое, у меня была та же проблема с mingw32 vers 4.8.1 на 2015/02/13. Компиляция с использованием Eclipse CDT не удалась с этим сообщением. Пытаюсь из командной строки с опцией-V также не удалось. Я также отсутствует исполняемый cc1plus.

причиной:
Я загрузил командную строку и графический установщик с сайта mingw32. Я использовал это для первоначальной установки mingw32. Используя GUI, я выбрал базовые инструменты, выбрав как c, так и c++ компиляторы.

этот установщик сделал неполную установку 32-битного компилятора C++. У меня были файлы g++ и cpp, но не исполняемый файл cc1plus. Попытка сделать «обновление» не удалась, потому что установщик предположил, что у меня все установлено.

чтобы исправить я нашел эти сайты:
http://mingw-w64.sourceforge.net/
http://sourceforge.net/projects/mingw-w64/
Я загрузил и запустил эту «онлайн-установку». Конечно, в этом были недостающие файлы. Я изменил переменную моего пути и указал на папку «bin», содержащую исполняемый файл g++. Перезагрузившей. Установлен 64 бит Eclipse. Открыл Eclipse и программу «Hello World» c++, скомпилированную, выполненную и отлаженную должным образом.

Примечание: 64-битный установщик, кажется, по умолчанию для настроек UNIX. Почему установщик определит ОС??? Обязательно измените их.

Я провел целый вечер, занимаясь этим. Надеюсь, это кому-то поможет.


У меня была та же проблема.

У меня уже был компилятор g++, установленный через MinGW (пакет mingw32-gcc-g++) но мне нужен был компилятор C, поэтому я запустил mingw-get-setup.exe, где я смог его установить mingw32-базы пакет с компилятором.

увы! У меня была эта ошибка, когда я использую gcc для компиляции:

gcc: ошибка: createprocess: нет такого файла или каталога

то, что я сделал, все еще используя менеджер установки MinGW, я удалил пакеты компиляторов C и C++, а именно mingw32-базы и mingw32-gcc-g++ и удалить сам каталог c:mingw . Затем я повторил mingw-get-setup.exe, установлен mingw32-базы и вуаля, это сработало 🙂


I had a very long path, and there’s a file in there somewhere (not gcc.exe) but another file, that gcc.exe is accessing from the path..

So when I cleared the path, it worked

C:MinGW>cd bin


C:MinGWbin>where gcc.exe
C:MinGWbingcc.exe
C:Perl64sitebingcc.exe

^^ So running gcc from there will definitely run the ming gcc.exe

C:MinGWbin>type file6.c
#include<stdio.h>
void main()
{
int num1,num2;
scanf("%2d %4d",&num1,&num2);
printf("a=%d b=%d",num1,num2);
scanf("%d",&num1);
//flushall();
printf("c=%d",num1);
}

Compiling it I got this error

C:MinGWbin>gcc file6.c
gcc: error: CreateProcess: No such file or directory

My PATH was huge

C:MinGWbin>path
PATH=C:Windowssystem32;C:Windows;C:Windowssystem32wbem;C:P......

C:MinGWbin>path | grep -io «ming»

It didn’t have ming there.

C:MinGWbin>echo MING | grep -io «ming»
MING

(and yeah that grep works..the path didn’t have ming there)

Clearing my path completely, led it to work!

C:MinGWbin>set PATH=

C:MinGWbin>gcc file6.c

C:MinGWbin>

So, it’s not clear yet precisely what it was in the PATH that led to the clash. What directory, what file.

Update-

The above seems to be correct to me but to add, it’s also not a simple case of something earlier in the path clashing.. because normally the current directory takes precedence. And it does here in so far as gcc —version shows it’s running the ming one and not one of the ones in a conflicting directory. So there’s something funny going on that, if the conflicting directory is in the path) , one has to either do .gcc or add . to the start of the path or add c:MinGWbin before any conflicting directories in the path. this is the case even when you’re in C:MinGWbin and that’s strange. And when it gives an error, it is still running Ming’s gcc but (For some reason) looking at the conflicting directory too, as I see from process monitor. There may be more of an answer here http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista in the link mentioned in the very upvoted answer here

That’s Ming32 bit..

Looking at Ming 64bit, probably has te same issue, but I see, interestingly, it comes with a bat file that (sensibly) actually puts the bin directory at the tart of the path. And it looks like that is a standard way of running Ming gcc properly.

The code::blocks IDE (sensibly) also puts the bin directory at the start of the path. If you run a C program that shows environment variables then you see that.

Topic: Weird «CreateProcess: No such file or directory» error  (Read 49281 times)

I installed C::B version 12.11 with the minGW from the site
Created a new console project
C language
debug+release
compiled the «main.c».
Expected to see the «Hello World!» but I got this error which is on my nerves about 6 hours!

————— Clean: Debug in Euler (compiler: GNU GCC Compiler)—————

Cleaned «Euler — Debug»

————— Build: Debug in Euler (compiler: GNU GCC Compiler)—————

mingw32-gcc.exe -Wall  -g     -c «C:…Project FilesCodesEulermain.c» -o objDebugmain.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)

Where is the problem?
 :'( :'( :'(
==>>SOLUTION:<<==
In my case, the problem resulted from a program called EGCS (Experimental/Enhanced GNU Compiler System).
I installed it as a prerequisite for PSCAD(Power Systems CAD) along with a FORTRAN Compiler.
Just remove it, and you’ll be fine
(Sadly, I deleted the entire PATH environmental variable due to a mistake. So what?…I ended up installing a new Win7 but after uninstalling my Ubuntu which again due to the Boot difficulties _which resulted from uninstalling GRUB_, I again ended up messing around with fixmbr and fixboot fellas(But I’ve lost my Laptop DVD!)…In summary, The EGCS laughed at me for a 1/2-MONTH…)

« Last Edit: July 15, 2013, 11:32:33 am by PooyaM »


Logged


ToApolytoXaos

Avoid creating projects inside Program Files for many reasons. Move it to C: and try again. If it fails, try to reinstall your C::B and recompile your project again.


Logged


PooyaM: You forgot to tell what compiler are you using and what OS.

ToApolytoXaos: I don’t think he is using C:program files :)


Logged

(most of the time I ignore long posts)
[strangers don’t send me private messages, I’ll ignore them; post a topic in the forum, but first read the rules!]


Apart from the known issue (which is not related to Code::Blocks but to MinGW) with pathnames that contain spaces such as «Program Files», there is another issue with program prefixes and suffixes, in this case, the «mingw32» bit.

Be sure that there exists a program

gcc.exe

in addition to

mingw32-gcc.exe

(and one non-prefixed version of every single compiler executable). If it does not, make a copy. Do note that neither symbolic links nor junctions seem to work. Junctions should actually work without the program knowing, but they don’t do for me, neither under Windows XP, nor Windows 7, nor Windows 8.

This is even worse with TDragon’s otherwise excellent GCC distribution. This one also uses suffixes in addition to prefixes (for example

-DW2

) which will cause tools like

windres

to fail with the exact same error that you see — and no obvious explanation for why they fail, if you don’t already know the reason.


Logged

«We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation.»


ToApolytoXaos

PooyaM: You forgot to tell what compiler are you using and what OS.

ToApolytoXaos: I don’t think he is using C:program files :)

————— Build: Debug in Euler (compiler: GNU GCC Compiler)—————

mingw32-gcc.exe -Wall  -g     -c «C:…Project FilesCodesEulermain.c» -o objDebugmain.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)

and the above is considered what? we do know that certain windows XP cause the same issue like Windows Vista / Windows 7 with permissions. it could be something like this, i might be wrong; but, as a newbie myself i have fell into the same trap and had to deal with it for a couple of hours until i figure it out.


Logged


ToApolytoXaos: A path inside «c:Documents and settingsblabla» or the modern «c:userblabla»


Logged

(most of the time I ignore long posts)
[strangers don’t send me private messages, I’ll ignore them; post a topic in the forum, but first read the rules!]


ToApolytoXaos

@oBFusCATed: It seems you are not paying attention of what i’m saying. I have mentioned permissions apart from spaces within path (actually, i did not mention anything about spaces). Indeed it’s a common issue, at least on Windows 7; it has though happened to me once with Windows XP, but i’m afraid I don’t remember what exactly I did and caused such issue. Anyway, let’s hope this guy solves his problems.

« Last Edit: June 30, 2013, 12:58:22 pm by ToApolytoXaos »


Logged


I use Windows 7/64bit.
Actually, I’ve used C::B vesion 10 since 2 days ago. I compiled and successfully runned about 20 codes in C in the past(even with a use of GMP library). When I got some strange error, I removed the previous file and added the new file to the project(I think the error was a result of using two «main()»s)
But yesterday, this STRANGE error popped up. I uninstalled C::B 10 and downloaded and installed the 12.11 version with minGW(32bit if matters). The error still existed…
Note:After installing the 12.11 version, A window popped up asking about my default compiler and it marked some other compilers(like Visual C++ and FORTRAN) with the color red(And I have MS Visual studio 2008 installed if it matters). What is this red mark story?  ???

Avoid creating projects inside Program Files for many reasons. Move it to C: and try again. If it fails, try to reinstall your C::B and

Moved to C:/ … Error still exists:

————— Build: Debug in C (compiler: GNU GCC Compiler)—————

mingw32-gcc.exe -Wall  -g     -c C:CodesindriveCCmain.c -o objDebugmain.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)

Apart from the known issue (which is not related to Code::Blocks but to MinGW) with pathnames that contain spaces such as «Program Files»,

Both gcc.exe and mingw32-gcc.exe and couples like gcc-ar.exe and ar.exe exist in MinGW folder in CodeBlocks directory

« Last Edit: June 30, 2013, 01:25:19 pm by PooyaM »


Logged


If you have ruled out all the «well-known» issues, you can use ProcessMonitor to see what is actually going wrong.

In addition to «no such file», this will also tell you exactly what file (and path) it was looking for. That may help narrow down the problem.


Logged

«We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation.»


If you have ruled out all the «well-known» issues, you can use ProcessMonitor to see what is actually going wrong.

In addition to «no such file», this will also tell you exactly what file (and path) it was looking for. That may help narrow down the problem.

How can I use this program?
When I compile, Process Monitor won’t update


Logged


I got something.
When I make a new file(test.c) and check both debug and release, There is not any objDebugtest.o file in the directory.Why ?


Logged


You have to build the target after you’ve added the file. Have you?


Logged

(most of the time I ignore long posts)
[strangers don’t send me private messages, I’ll ignore them; post a topic in the forum, but first read the rules!]



Logged


http://forums.codeblocks.org/index.php/topic,17030.0.html

«Adding build target» is not a usual routine, is it?

what do you mean with Adding abuild target?
You create a Project and add the files to it and, if you want, you can create build targets, for different tasks or build options (like release and debug)…

99% of this «CreateProcess: No such file or directory» are MinGW related. Try to uninstall it, and reinstall it… !!! MinGW and not CodeBlocks !!!!
Have you installed an second compiler like devc++? If yes remove it’s path from the PATH environment.

greetings


Logged


http://forums.codeblocks.org/index.php/topic,17030.0.html

«Adding build target» is not a usual routine, is it?

99% of this «CreateProcess: No such file or directory» are MinGW related. Try to uninstall it, and reinstall it… !!! MinGW and not CodeBlocks !!!!
Have you installed an second compiler like devc++? If yes remove it’s path from the PATH environment.

Worked!
Thanks for the link.I’ll update my post


Logged


0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Gc a12hr ошибка f0
  • Gboard ошибка как исправить xiaomi