Yet Another MinGW “gcc: error: CreateProcess: No such file or directory”

后端 未结 8 2055
轻奢々
轻奢々 2020-11-30 09:03

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

相关标签:
8条回答
  • 2020-11-30 09:42

    In my case, getting rid of the [=n] parameter when specifying -flto solved the problem.

    Specifically, instead of using

    -flto=6
    

    in CFLAGS, CXXFLAGS and LDFLAGS, I'm now using simply

    -flto
    


    Looks like this is a MinGW-w64 bug, thought at this point I'm not sure whether it might be caused by my using of the -j6 parameter when invoking make.

    For future reference, my entire command line is as follows:

    mingw32-make -f makefile.gcc CFLAGS="-std=c11 -pipe -O3 -flto" CXXFLAGS="-std=c++14 -pipe -O3 -flto" LDFLAGS="-pipe -O3 -flto -static-libgcc -static-libstdc++ -s -Wl,--allow-multiple-definition" BUILD=release RUNTIME_LIBS=static DEBUG_FLAG=0 USE_AUI=0 USE_HTML=0 USE_MEDIA=0 USE_OPENGL=0 USE_PROPGRID=0 USE_QA=0 USE_RIBBON=0 USE_RICHTEXT=0 USE_STC=0 USE_WEBVIEW=0 USE_XRC=0 CFG="-stl-static_runtime-O3-flto" -j6
    

    This is for building wxWidgets' "Minimal Sample". About -Wl,--allow-multiple-definition : It's intended to circumvent yet another toolchain bug. More info here and here.

    0 讨论(0)
  • 2020-11-30 09:46

    In my case, the installer mingw-get-setup.exe failed to download some files, so the gcc complication tool chain is broken, when rerun mingw-get-setup.exe and get the lost files, it is OK.

    0 讨论(0)
提交回复
热议问题