Page 1 of 1

stat error?

Posted: Fri Jan 23, 2026 4:28 am
by itswimlibid
...

User@WINWORK-TCBP05P MINGW64 ~
https://github.com/msys2/msys2-installe ... 251213.exe

pacman -Syu --noconfirm
pacman -Syu --noconfirm git
git clone https://wimlib.net/git/wimlib
cd wimlib
$ tools/windows-build.sh --install-prerequisites
..
..
..

make all-am
make[1]: Entering directory '/home/User/wimlib'
CC programs/wimlib_imagex-imagex.o
CC programs/wimlib_imagex-imagex-win32.o
programs/imagex.c: In function 'file_get_size':
programs/imagex.c:760:29: error: passing argument 2 of '_wstat64' from incompatible pointer type [-Wincompatible-pointer-types]
760 | if (tstat(filename, &st) == 0)
| ^~~
| |
| struct stat *
In file included from ./include/wimlib_tchar.h:8,
from programs/imagex.c:30:
D:/msys64/mingw64/include/wchar.h:277:69: note: expected 'struct _stat64 *' but argument is of type 'struct stat *'
277 | _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
| ~~~~~~~~~~~~~~~~^~~~~
programs/imagex.c: In function 'imagex_capture_or_append':
programs/imagex.c:1983:46: error: passing argument 2 of '_wstat64' from incompatible pointer type [-Wincompatible-pointer-types]
1983 | if (create && tstat(wimfile, &stbuf) != 0 && errno == ENOENT) {
| ^~~~~~
| |
| struct stat *
D:/msys64/mingw64/include/wchar.h:277:69: note: expected 'struct _stat64 *' but argument is of type 'struct stat *'
277 | _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
| ~~~~~~~~~~~~~~~~^~~~~
programs/imagex.c: In function 'imagex_export':
programs/imagex.c:2918:57: error: passing argument 2 of '_wstat64' from incompatible pointer type [-Wincompatible-pointer-types]
2918 | if (dest_wimfile != NULL && tstat(dest_wimfile, &stbuf) == 0) {
| ^~~~~~
| |
| struct stat *
D:/msys64/mingw64/include/wchar.h:277:69: note: expected 'struct _stat64 *' but argument is of type 'struct stat *'
277 | _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
| ~~~~~~~~~~~~~~~~^~~~~
make[1]: *** [Makefile:1985: programs/wimlib_imagex-imagex.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/User/wimlib'
make: *** [Makefile:990: all] Error 2



I would like to know how to solve this.

Re: stat error?

Posted: Fri Jan 23, 2026 4:35 am
by synchronicity
Is this wimlib v1.14.4? And are you following the instructions from "Building from source" in the README.WINDOWS.md file?

Re: stat error?

Posted: Fri Jan 23, 2026 4:38 am
by itswimlibid
synchronicity wrote: Fri Jan 23, 2026 4:35 am Is this wimlib v1.14.4? And are you following the instructions from "Building from source" in the README.WINDOWS.md file?
User@WINWORK-TCBP05P MINGW64 ~/wimlib

yes
https://github.com/msys2/msys2-installe ... 251213.exe

pacman -Syu --noconfirm
pacman -Syu --noconfirm git
git clone https://wimlib.net/git/wimlib
cd wimlib
tools/windows-build.sh --install-prerequisites


stat.h compatible problem?

Re: stat error?

Posted: Sat Jan 24, 2026 10:21 pm
by itswimlibid
구글 검색 결과
이전 버전의 stat.h 를 사용하라는 의견도 있는데
지금 컴파일 되는 stat.h 구핼 수 있을 까요?

Google search results
Some people suggest using an older version of stat.h.
Is it possible to obtain a stat.h that compiles correctly?

Re: stat error?

Posted: Fri Jan 30, 2026 3:12 am
by synchronicity
I've fixed this in commit 3b9fa443e90d382e53133d165ae79e45d7c98178. Please pull down the latest "master" branch, and it should work now.

Re: stat error?

Posted: Fri Jan 30, 2026 5:41 am
by itswimlibid
synchronicity wrote: Fri Jan 30, 2026 3:12 am I've fixed this in commit 3b9fa443e90d382e53133d165ae79e45d7c98178. Please pull down the latest "master" branch, and it should work now.
It worked perfectly. Thank you.