From d43ede9b7d7c5441197e4479a3fd11888c32c3af Mon Sep 17 00:00:00 2001 From: CodingKoopa Date: Fri, 8 Mar 2024 06:23:21 +0000 Subject: [PATCH] libntfs-3g: link to ntdll.dll on Windows win32_io.c uses some symbols from this DLL. Fixes linker error (among others): /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: .libs/libntfs_3g_la-win32_io.o: in function `ntfs_device_win32_pio': /cygdrive/e/Documents/Programs/ntfs-3g/libntfs-3g/win32_io.c:1386:(.text+0x274): undefined reference to `NtWriteFile' /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/e/Documents/Programs/ntfs-3g/libntfs-3g/win32_io.c:1391:(.text+0x348): undefined reference to `NtReadFile' --- libntfs-3g/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libntfs-3g/Makefile.am b/libntfs-3g/Makefile.am index 6feba7d7..28d873f3 100644 --- a/libntfs-3g/Makefile.am +++ b/libntfs-3g/Makefile.am @@ -14,6 +14,10 @@ libntfs_3g_la_CPPFLAGS= $(AM_CPPFLAGS) $(LIBNTFS_CPPFLAGS) -I$(top_srcdir)/inclu libntfs_3g_la_LIBADD = $(LIBNTFS_LIBS) libntfs_3g_la_LDFLAGS = -version-info $(LIBNTFS_3G_VERSION) -no-undefined +if WINDOWS +libntfs_3g_la_LDFLAGS += -lntdll +endif + libntfs_3g_la_SOURCES = \ acls.c \ attrib.c \