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.

-edit- it seems to be a problem with path and not being able to find its bin/ folder. Even though the g++ is in that bin directory.

I am trying to launch g++ on windows in my app but i get the error below. How do i fix it? side note i can do g++ dummy.cpp in the prompt with no problem.

args -o file.exe -x c++ -

stdout

: CreateProcess: No such file or directory

-edit- my code is…

#include <windows.h> 
#include <stdio.h> 
#include <strsafe.h>

#include <ios>
#include <iostream>
#include <fstream>
#include <sstream>
#include <exception>
#include <string>
#include <deque>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

string gcc_bin="E:/dev/external/MinGW/bin/g++.exe";
string gcc_folder="E:/dev/external/MinGW/bin/";

int launch_gcc(ostringstream&o);
int main(){
    ostringstream osz;
    osz << "#include <cstdio>" << endl << "int main(){ printf("hello"); } return 4; }";
    {
        launch_gcc(osz);
    }
    return 0;
}





void ErrorExit(PTSTR);
int launch_gcc(ostringstream&o)
{

    char buf2[4096];
char buf[4096];
ExpandEnvironmentStrings("%PATH%", buf, 4095);
OutputDebugString(buf);

    sprintf(buf2, "PATH=%s;%s;", gcc_folder.c_str(), buf);

    STARTUPINFO startupInfo;
    PROCESS_INFORMATION processInformation;

    HANDLE g_hChildStd_IN_Rd = NULL;
    HANDLE g_hChildStd_IN_Wr = NULL;
    HANDLE g_hChildStd_OUT_Rd = NULL;
    HANDLE g_hChildStd_OUT_Wr = NULL;
    HANDLE g_hChildStd_ERR_Rd = NULL;
    HANDLE g_hChildStd_ERR_Wr = NULL;

    HANDLE g_hInputFile = NULL;

    SECURITY_ATTRIBUTES saAttr;  
    saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); 
    saAttr.bInheritHandle = TRUE; 
    saAttr.lpSecurityDescriptor = NULL; 

    if ( ! CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr, 0) ) 
    ErrorExit(TEXT("StdoutRd CreatePipe")); 
    if ( ! SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0) )
    ErrorExit(TEXT("Stdout SetHandleInformation"));

    if ( ! CreatePipe(&g_hChildStd_ERR_Rd, &g_hChildStd_ERR_Wr, &saAttr, 0) ) 
    ErrorExit(TEXT("StderrRd CreatePipe")); 
    if ( ! SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0) )
    ErrorExit(TEXT("Stderr SetHandleInformation"));

    if (! CreatePipe(&g_hChildStd_IN_Rd, &g_hChildStd_IN_Wr, &saAttr, 0)) 
    ErrorExit(TEXT("Stdin CreatePipe")); 
    if ( ! SetHandleInformation(g_hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0) )
    ErrorExit(TEXT("Stdin SetHandleInformation")); 

    ZeroMemory( &startupInfo, sizeof(STARTUPINFO) );
    startupInfo.cb = sizeof(STARTUPINFOA); 
    startupInfo.hStdError = g_hChildStd_OUT_Wr;
    startupInfo.hStdOutput = g_hChildStd_ERR_Wr;
    startupInfo.hStdInput = g_hChildStd_IN_Rd;
    startupInfo.dwFlags |= STARTF_USESTDHANDLES;

    ZeroMemory( &processInformation, sizeof(PROCESS_INFORMATION) );

    bool bSuccess = CreateProcess(
        gcc_bin.c_str(),
        " -o "c:/dev/src/git/myprj/theout.exe" -x c++ -",
0,
  0,
  1,
  NORMAL_PRIORITY_CLASS,
  0,//buf2,
  0,//gcc_folder.c_str(),
  &startupInfo,
  &processInformation
);
   if ( ! bSuccess ) 
      ErrorExit(TEXT("CreateProcess"));
   else 
   {
      // Close handles to the child process and its primary thread.
      // Some applications might keep these handles to monitor the status
      // of the child process, for example. 

      CloseHandle(processInformation.hProcess);
      CloseHandle(processInformation.hThread);
   }


    { 
    DWORD dwRead, dwWritten; 
    BOOL bSuccess = FALSE;

    auto sz=o.str();
    bSuccess = WriteFile(g_hChildStd_IN_Wr, sz.c_str(), sz.size(), &dwWritten, NULL);
    //if ( ! bSuccess ) break; 

    if ( ! CloseHandle(g_hChildStd_IN_Wr) ) 
        ErrorExit(TEXT("StdInWr CloseHandle")); 
    } 



    #define BUFSIZE 1024*4
    { 
    DWORD dwRead, dwWritten; 
    CHAR chBuf[BUFSIZE]; 
    BOOL bSuccess = FALSE;
    HANDLE hParentStdOut = GetStdHandle(STD_OUTPUT_HANDLE);

    chBuf[0]=0;
    if (!CloseHandle(g_hChildStd_OUT_Wr)) 
        ErrorExit(TEXT("StdOutWr CloseHandle")); 

    for (;;) 
    { 
        bSuccess = ReadFile( g_hChildStd_OUT_Rd, chBuf, BUFSIZE, &dwRead, NULL);
        if( ! bSuccess || dwRead == 0 ) break; 

        bSuccess = WriteFile(hParentStdOut, chBuf, 
                            dwRead, &dwWritten, NULL);
        chBuf[dwWritten]=0;
        if (! bSuccess ){ 
            printf("%s", chBuf);
            break; 
        }
    } 
    }

    { 
    DWORD dwRead, dwWritten; 
    CHAR chBuf[BUFSIZE]; 
    BOOL bSuccess = FALSE;
    HANDLE hParentStdErr = GetStdHandle(STD_ERROR_HANDLE);

    if (!CloseHandle(g_hChildStd_ERR_Wr)) 
        ErrorExit(TEXT("StdOutWr CloseHandle")); 

    for (;;) 
    { 
        bSuccess = ReadFile( g_hChildStd_ERR_Rd, chBuf, BUFSIZE, &dwRead, NULL);
        if( ! bSuccess || dwRead == 0 ) break; 

        bSuccess = WriteFile(hParentStdErr, chBuf, 
                            dwRead, &dwWritten, NULL);
        chBuf[dwWritten]=0;
        if (! bSuccess ){ 
            printf("%s", chBuf);
            break; 
        }
    }
    auto a=1;
    }


    return 0;
}

void ErrorExit(PTSTR lpszFunction) 
{ 
    LPVOID lpMsgBuf;
    LPVOID lpDisplayBuf;
    DWORD dw = GetLastError(); 

    FormatMessage(
        FORMAT_MESSAGE_ALLOCATE_BUFFER | 
        FORMAT_MESSAGE_FROM_SYSTEM |
        FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL,
        dw,
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
        (LPTSTR) &lpMsgBuf,
        0, NULL );

    lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, 
        (lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)lpszFunction)+40)*sizeof(TCHAR)); 
    StringCchPrintf((LPTSTR)lpDisplayBuf, 
        LocalSize(lpDisplayBuf) / sizeof(TCHAR),
        TEXT("%s failed with error %d: %s"), 
        lpszFunction, dw, lpMsgBuf); 
    MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); 

    LocalFree(lpMsgBuf);
    LocalFree(lpDisplayBuf);
    ExitProcess(1);
}

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.

4b9b3361

Ответ 1

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

Ответ 2

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

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

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

Ответ 3

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

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

Ответ 4

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

В моем случае проблема возникла из-за проблем при загрузке пакетов для 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» в моей системе), а затем снова запустить команду установки. Он загружает и устанавливает недостающие части GCC (он не полностью загрузил пакет gcc-core).

Это решило мою проблему.

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

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

Ответ 5

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

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

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

Ответ 6

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

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

В моем случае это случилось, когда он пытался вызвать cc1plus. Я проверил, у меня этого нет. Установленный компилятор Mingw С++, а затем я сделал.

Ответ 7

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

Используя ту же самую установку mingw32-make-3.80.0-3.exe из http://www.mingw.org/wiki/FAQ и вариант оболочки mingw из Start → Программы → на WinXP SP3 и gcc работают нормально.

Ответ 8

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

gcc -o stuff stuff.C

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

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

 gcc -o stuff stuff.c

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

Ответ 9

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

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

Ответ 10

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

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

Дополнительные сведения

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

Ответ 11

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

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

Ответ 12

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

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

C:MinGW>cd bin


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

^^ Так что запущенный gcc оттуда обязательно запустит 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);
}

Составив его, я получил эту ошибку

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 > эхо MING | grep -io «ming»
MING

(и да, что grep работает… на пути не было ming)

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

C:MinGWbin>set PATH=

C:MinGWbin>gcc file6.c

C:MinGWbin>

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

Update —

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

Что Ming32 бит..

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

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

Ответ 13

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

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

Пришлось прибегнуть к ProcMon, чтобы найти корень проблемы.

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

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

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

Ответ 14

Добавьте E:MinGWbin в переменную PATH.

Ответ 15

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

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

Ответ 16

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

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

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

Ответ 17

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

  • Когда вы сохраняете программу, скажем, ее имя hi.cpp помещено в папку, например. xxl затем сохраните вашу программу.

  • Отрежьте эту папку и поместите ее в папку bin в потоке.

  • Когда вы вызываете программу:

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

Ответ 18

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

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

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

Ответ 19

(Ссылаясь на оригинальную проблему)
Сегодня версия 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

Ответ 20

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

Ответ 21

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

Ответ 22

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

Ответ 23

Хотя пост старый, у меня была та же проблема с mingw32 vers 4.8.1 от 2015/02/13. С этим сообщением завершилось компиляция с использованием Eclipse CDT. Также не удалось выполнить попытку из командной строки с опцией -v. Мне также не хватает исполняемого файла cc1plus.

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

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

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

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

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

Ответ 24

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

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

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

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

Что я делал, так и было, используя MinGW Installation Manager, я удалил компиляторы C и С++, а именно mingw32-base и mingw32-gcc-g++ и ТАКЖЕ удалил сам каталог C:MinGW. Затем я повторно запустил mingw-get-setup.exe, установил mingw32-base, и voila, он работал:)

Topic: Weird «CreateProcess: No such file or directory» error  (Read 50289 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


Возможно, вам также будет интересно:

  • Gbladapter dll ошибка гарант
  • Gazlux standard ошибка ep как устранить
  • Gazlux standard ошибка e1 что делать
  • Gazlux economy ошибки котел
  • Gazeco 24 t1 ошибка е1 как устранить

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

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