stat error?
Posted: Fri Jan 23, 2026 4:28 am
...
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
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
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
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.
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 | 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 | 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
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.