MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

gcc not work

Open happytam opened this issue 5 months ago • 13 comments

Description / Steps to reproduce the issue

tam@DESKTOP-OE92IV8 UCRT64 ~ $ gcc --version gcc.exe (Rev8, Built by MSYS2 project) 15.2.0 Copyright (C) 2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

tam@DESKTOP-OE92IV8 UCRT64 ~ $ cat hello.c #include <stdio.h>

int main() { printf("Hello, World!\n"); return 0; } tam@DESKTOP-OE92IV8 UCRT64 ~ $ gcc -v hello.c -o hello.exe Using built-in specs. COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../gcc-15.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --with-native-system-header-dir=/mingw64/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-mingw-wildcard --enable-lan guages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-backtrace=yes --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enabl e-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev8, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-libstdcxx-zoneinfo=yes --disable-libstdcxx-debug --enable-plugin --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 15.2.0 (Rev8, Built by MSYS2 project) COLLECT_GCC_OPTIONS='-v' '-o' 'hello.exe' '-mtune=generic' '-march=nocona' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/cc1.exe -quiet -v -iprefix C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/ -D_REENTRANT hello.c -quiet -dumpbase hello.c -dumpbase-ext .c -mtune=generic -march=nocona -version -o C:\msys64\tmp\ccR29wdc.s GNU C23 (Rev8, Built by MSYS2 project) version 15.2.0 (x86_64-w64-mingw32) compiled by GNU C version 15.2.0, GMP version 6.3.0, MPFR version 4.2.2, MPC version 1.3.1, isl version isl-0.27-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/include" ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/include" ignoring nonexistent directory "D:/M/msys64/mingw64/include" ignoring nonexistent directory "/mingw64/include" ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/include-fixed" ignoring nonexistent directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/include" ignoring nonexistent directory "D:/M/msys64/mingw64/include" #include "..." search starts here: #include <...> search starts here: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/include C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../include C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/include-fixed End of search list. Compiler executable checksum: feaaa8b8d0ead308dc62d839201f7330 COLLECT_GCC_OPTIONS='-v' '-o' 'hello.exe' '-mtune=generic' '-march=nocona' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o C:\msys64\tmp\ccCDrKCr.o C:\msys64\tmp\ccR29wdc.s

tam@DESKTOP-OE92IV8 UCRT64 ~ $ ls hello.c

tam@DESKTOP-OE92IV8 UCRT64 ~ $

Expected behavior

output hello.exe

Actual behavior

no error ,and not found hello.exe

Verification

  • [x] I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)

Windows Version

Windows 10 22H2 , OS version 19045.6332

MINGW environments affected

  • [ ] MINGW64
  • [ ] MINGW32
  • [x] UCRT64
  • [ ] CLANG64
  • [ ] CLANGARM64

Are you willing to submit a PR?

No response

happytam avatar Sep 18 '25 14:09 happytam

Even when antivirus software and firewall are both turned off, it is still impossible to compile an executable file.

happytam avatar Sep 18 '25 14:09 happytam

Works on my machine

Peter0x44 avatar Sep 18 '25 14:09 Peter0x44

Something wrong w/ user setup: terminal says UCRT64, but used toolchain is C:/msys64/mingw64?!

kmilos avatar Sep 18 '25 15:09 kmilos

When I switch to the MinGW64 terminal , the same issue persists.

tam@DESKTOP-OE92IV8 MINGW64 ~ $ ls hello.c

tam@DESKTOP-OE92IV8 MINGW64 ~ $ gcc -v hello.c -o hello.exe Using built-in specs. COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../gcc-15.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --with-native-system-header-dir=/mingw64/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-mingw-wildcard --enable-lan guages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-backtrace=yes --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enabl e-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev8, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-libstdcxx-zoneinfo=yes --disable-libstdcxx-debug --enable-plugin --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 15.2.0 (Rev8, Built by MSYS2 project) COLLECT_GCC_OPTIONS='-v' '-o' 'hello.exe' '-mtune=generic' '-march=nocona' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/cc1.exe -quiet -v -iprefix C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/ -D_REENTRANT hello.c -quiet -dumpbase hello.c -dumpbase-ext .c -mtune=generic -march=nocona -version -o C:\msys64\tmp\ccwQNU00.s GNU C23 (Rev8, Built by MSYS2 project) version 15.2.0 (x86_64-w64-mingw32) compiled by GNU C version 15.2.0, GMP version 6.3.0, MPFR version 4.2.2, MPC version 1.3.1, isl version isl-0.27-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/include" ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/include" ignoring nonexistent directory "D:/M/msys64/mingw64/include" ignoring nonexistent directory "/mingw64/include" ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/include-fixed" ignoring nonexistent directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/include" ignoring nonexistent directory "D:/M/msys64/mingw64/include" #include "..." search starts here: #include <...> search starts here: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/include C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../include C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/include-fixed End of search list. Compiler executable checksum: feaaa8b8d0ead308dc62d839201f7330 COLLECT_GCC_OPTIONS='-v' '-o' 'hello.exe' '-mtune=generic' '-march=nocona' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o C:\msys64\tmp\cccPfnE7.o C:\msys64\tmp\ccwQNU00.s

tam@DESKTOP-OE92IV8 MINGW64 ~ $ ls hello.c

happytam avatar Sep 18 '25 15:09 happytam

Calling gcc (mingw64) from ucrt64 shell shouldn't be possible, could you show $PATH

$ echo $PATH

Maybe you changed the path.

I did add /mingw64/bin to the PATH before and removed it. I am using the ucrt64 gcc compiler, but I don't know why it still hasn't generated an executable file.

tam@DESKTOP-OE92IV8 UCRT64 ~ $ echo $PATH /ucrt64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

tam@DESKTOP-OE92IV8 UCRT64 ~ $ ls hello.c

tam@DESKTOP-OE92IV8 UCRT64 ~ $ gcc hello.c -o hello.exe

tam@DESKTOP-OE92IV8 UCRT64 ~ $ ls hello.c

happytam avatar Sep 19 '25 13:09 happytam

What does which gcc produce?

oltolm avatar Sep 20 '25 11:09 oltolm

What does which gcc produce?

tam@DESKTOP-OE92IV8 UCRT64 ~ $ which gcc /ucrt64/bin/gcc

happytam avatar Sep 21 '25 09:09 happytam

Did you try a clean installation, I mean delete everything and reinstall MSYS2.

Yes, I have reinstalled, and I have only executed pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain. I still cannot compile the binary files.

happytam avatar Sep 23 '25 12:09 happytam

Did you try a clean installation, I mean delete everything and reinstall MSYS2.

Yes, I have reinstalled, and I have only executed pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain. I still cannot compile the binary files.

That's not what I mean, remove MSYS2 and reinstall it again.

The uninstallation has been confirmed, and the installation directory no longer exists.

happytam avatar Sep 25 '25 23:09 happytam

Just a note, I ran into something like this, and in my case I had mistakenly left an old libwinpthread-1.dll in my path which, when removed, cleared up the problem.

Don't know if that helps or is relevant.

SmileTheory avatar Oct 20 '25 10:10 SmileTheory

I just solved a similar problem in my environment. The issue was a classic DLL conflict on windows 11, which was solved by adjusting the system's PATH variable. My system had two copies of neccessary library(zib1.dll) ,one correct version in "C:\msys64\ucrt64\bin" and one potentially incompatible version installed by Intel. By moving the MinGW binary path (e.g., C:\msys64\ucrt64\bin) to the front of the Intel's PATH, the correct files were loaded, allowing the linking process to complete successfully.

PradiptaPradhanang avatar Nov 12 '25 14:11 PradiptaPradhanang

I've also run into this trouble. how to resolve pls.

Stoneman@ssr-amd UCRT64 /tmp
$ cat test.c
int main(){return 0;}

Stoneman@ssr-amd UCRT64 /tmp
$ gcc -v ./test.c
Using built-in specs.
COLLECT_GCC=C:\msys64\ucrt64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-15.2.0/configure --prefix=/ucrt64 --with-local-prefix=/ucrt64/local --with-native-system-header-dir=/ucrt64/include --libexecdir=/ucrt64/lib --enable-bootstrap --enable-checking=release --with-arch=nocona --with-tune=generic --enable-mingw-wildcard --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-backtrace=yes --enable-libstdcxx-filesystem-ts --enable-libstdcxx-time --disable-libstdcxx-pch --enable-lto --enable-libgomp --disable-libssp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/ucrt64 --with-mpfr=/ucrt64 --with-mpc=/ucrt64 --with-isl=/ucrt64 --with-pkgversion='Rev8, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-libstdcxx-zoneinfo=yes --disable-libstdcxx-debug --enable-plugin --with-boot-ldflags=-static-libstdc++ --with-stage1-ldflags=-static-libstdc++
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.0 (Rev8, Built by MSYS2 project)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=nocona' '-dumpdir' 'a-'
 C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/cc1.exe -quiet -v -iprefix C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/ -D_REENTRANT ./test.c -quiet -dumpdir a- -dumpbase test.c -dumpbase-ext .c -mtune=generic -march=nocona -version -o C:\msys64\tmp\ccMZthmh.s
GNU C23 (Rev8, Built by MSYS2 project) version 15.2.0 (x86_64-w64-mingw32)
        compiled by GNU C version 15.2.0, GMP version 6.3.0, MPFR version 4.2.2, MPC version 1.3.1, isl version isl-0.27-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/include"
ignoring duplicate directory "C:/msys64/ucrt64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/include"
ignoring nonexistent directory "D:/M/msys64/ucrt64/include"
ignoring nonexistent directory "/ucrt64/include"
ignoring duplicate directory "C:/msys64/ucrt64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/include-fixed"
ignoring nonexistent directory "C:/msys64/ucrt64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "D:/M/msys64/ucrt64/include"
#include "..." search starts here:
#include <...> search starts here:
 C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/include
 C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../include
 C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/include-fixed
End of search list.
Compiler executable checksum: f68563dd6aebdc6b84233a210e98d3c3
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=nocona' '-dumpdir' 'a-'
 C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o C:\msys64\tmp\ccAnKR9t.o C:\msys64\tmp\ccMZthmh.s

Stoneman@ssr-amd UCRT64 /tmp
$ ls
test.c

Stoneman@ssr-amd UCRT64 /tmp
$ env
ProgramFiles(x86)=C:\Program Files (x86)
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
!C:=C:\msys64\home\Stoneman
!ExitCode=00000000
SHELL=/usr/bin/bash
MSYS2_NOSTART=yes
NUMBER_OF_PROCESSORS=12
PROCESSOR_LEVEL=25
WD=C:\msys64\usr\bin\
WIRESHARK_CONFIG_DIR=C:\Users\QQ769\scoop\apps\wireshark\current\Data
__BAK_CMAKE_PREFIX_PATH=C:\Users\QQ769\scoop\apps\msys2\current\ucrt64;D:\Qt\5.15.2\mingw81_64
MINGW_PREFIX=/ucrt64
PKG_CONFIG_PATH=/ucrt64/lib/pkgconfig:/ucrt64/share/pkgconfig
USERDOMAIN_ROAMINGPROFILE=SSR-AMD
WT_SESSION=81b48503-11e6-4f8a-b5d6-9057504efcac
HOSTNAME=ssr-amd
PROGRAMFILES=C:\Program Files
MSYS2_PATH_TYPE=strict
MSYSTEM=UCRT64
ChocolateyInstall=C:\ProgramData\chocolatey
DEPOT_TOOLS_WIN_TOOLCHAIN=0
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
JAVA_HOME=C:\Users\QQ769\scoop\apps\openjdk17\current
WIRESHARK_DATA_DIR=C:\Users\QQ769\scoop\apps\wireshark\current\Data
ORIGINAL_TEMP=/c/Users/QQ769/AppData/Local/Temp
DOTNET_CLI_TELEMETRY_OPTOUT=1
MINGW_CHOST=x86_64-w64-mingw32
OS=Windows_NT
HOMEDRIVE=C:
MSYSTEM_CARCH=x86_64
MYPKGS_DIR=E:\rtt-packages
USERDOMAIN=SSR-AMD
PWD=/tmp
USERPROFILE=C:\Users\QQ769
OneDriveConsumer=C:\Users\QQ769\OneDrive
MANPATH=/ucrt64/local/man:/ucrt64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=pdfFactory Pro
QPC=E:\repositories\qpc
PATH_TO_FX=C:\Users\QQ769\scoop\apps\gluon-openjfx-sdk\current\lib
AMDRMPATH=C:\Program Files\AMD\RyzenMaster\
TZ=Asia/Shanghai
MINGW_PACKAGE_PREFIX=mingw-w64-ucrt-x86_64
ALLUSERSPROFILE=C:\ProgramData
CommonProgramW6432=C:\Program Files\Common Files
HOME=/home/Stoneman
USERNAME=Stoneman
LANG=zh_CN.UTF-8
scoop_home=C:\Users\QQ769\scoop
OPENSSL_CONF=C:\Users\QQ769\scoop\apps\openssl-mingw\current\ssl\openssl.cnf
OneDrive=C:\Users\QQ769\OneDrive
CPOLAR_HOME=D:\Program Files\cpolar\
COMSPEC=C:\Windows\system32\cmd.exe
OPENSSL_INCLUDE_DIR=C:\Users\QQ769\scoop\apps\openssl\current\include
VCPKG_DEFAULT_TRIPLET=x64-windows
APPDATA=C:\Users\QQ769\AppData\Roaming
OPENSSL_MODULES=C:\Users\QQ769\scoop\apps\openssl\current\bin
SYSTEMROOT=C:\Windows
LOCALAPPDATA=C:\Users\QQ769\AppData\Local
CPM_SOURCE_CACHE=E:/CPM_SOURCE_CACHE
PROMPT=$P$G
COMPUTERNAME=SSR-AMD
INFOPATH=/ucrt64/local/info:/ucrt64/share/info:/usr/local/info:/usr/share/info:/usr/info:/share/info
__BAK_QT_INSTALL_PREFIX=D:\Qt\5.15.2\msvc2019_64
TERM=xterm-256color
LOGONSERVER=\\SSR-AMD
RTT_ROOT=E:\repositories\rt-thread
ACLOCAL_PATH=/ucrt64/share/aclocal:/usr/share/aclocal
USER=Stoneman
PSModulePath=C:\Users\QQ769\scoop\modules;C:\Users\QQ769\Documents\WindowsPowerShell\Modules
NSISDIR=C:\Users\QQ769\scoop\apps\nsis\current
LUA_EXE_PATH=C:\Users\QQ769\scoop\apps\lua\current\bin
TEMP=/tmp
MSYSTEM_CHOST=x86_64-w64-mingw32
ORIGINAL_TMP=/c/Users/QQ769/AppData/Local/Temp
SHLVL=1
UGIT_HOME=C:\Users\QQ769\scoop\apps\UGit\current
CHROME_EXECUTABLE=C:\Users\QQ769\scoop\apps\googlechrome\current\chrome.exe
PROCESSOR_REVISION=2100
DriverData=C:\Windows\System32\Drivers\DriverData
COMMONPROGRAMFILES=C:\Program Files\Common Files
CONICON=ucrt64.ico
MOZ_PLUGIN_PATH=C:\Users\QQ769\scoop\apps\foxit-reader\current\plugins\
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
SESSIONNAME=Console
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\$
WSLENV=WT_SESSION:WT_PROFILE_ID:
PGDATA=C:\Users\QQ769\scoop\apps\postgresql12\current\data
PKG_CONFIG_SYSTEM_LIBRARY_PATH=/ucrt64/lib
LUA_CPATH=C:\Users\QQ769\scoop\apps\lua\current\bin
HOMEPATH=\Users\QQ769
XDG_DATA_DIRS=/ucrt64/share/:/usr/local/share/:/usr/share/
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/ucrt64/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PhoenixPath=D:\PortableSoftware\allwinner_tools\PhoenixSuit_V2.0.0\
__BAK_CPLUS_INCLUDE_PATH=C:\Users\QQ769\scoop\apps\python\current\include
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/ucrt64
LOGINSHELL=bash
CONTITLE=MinGW UCRT x64
OPENSSL_LIB_DIR=C:\Users\QQ769\scoop\apps\openssl\current\lib
QtMsBuild=C:\Users\QQ769\AppData\Local\QtMsBuild
GIT_INSTALL_ROOT=C:\Users\QQ769\scoop\apps\git\current
WINDIR=C:\Windows
POSH_THEMES_PATH=C:\Users\QQ769\scoop\apps\oh-my-posh\current\themes
PROCESSOR_ARCHITECTURE=AMD64
WT_PROFILE_ID={17da3cac-b318-431e-8a3e-7fcdefe6d114}
PUBLIC=C:\Users\Public
PKG_CONFIG_SYSTEM_INCLUDE_PATH=/ucrt64/include
SYSTEMDRIVE=C:
ProgramData=C:\ProgramData
ChocolateyLastPathUpdate=133075107863830330
_=/usr/bin/env
OLDPWD=/home/Stoneman

shishirong avatar Dec 04 '25 03:12 shishirong

Can you check the exit code with echo $??

$ gcc test.c
$ echo $?

You can also try running gcc within gdb. Install mingw-w64-ucrt-x86_64-gdb and run:

$ gdb --args gcc test.c
gdb> run
(...wait for gcc to exit)
gdb> quit

lb90 avatar Dec 04 '25 22:12 lb90