From 35fc46e3ebfbe87eff7112e9ed48d8f60d6c4f55 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 2 Nov 2019 09:23:34 -0400 Subject: [PATCH] missing constants on mingw build fix Errors seen during build: o/windmain.o:windmain.c:(.rdata$.refptr.FOLDERID_ProgramData[.refptr.FOLDERID_ProgramData]+0x0): undefined reference to `FOLDERID_ProgramData' o/windmain.o:windmain.c:(.rdata$.refptr.FOLDERID_LocalAppData[.refptr.FOLDERID_LocalAppData]+0x0): undefined reference to `FOLDERID_LocalAppData' o/windmain.o:windmain.c:(.rdata$.refptr.FOLDERID_Profile[.refptr.FOLDERID_Profile]+0x0): undefined reference to `FOLDERID_Profile' collect2.exe: error: ld returned 1 exit status mingw32-make: *** [Makefile:849: ../binary/NetHack.exe] Error 1 DEFINE_KNOWN_FOLDER is using this particular definition in the mingw header files: rather than this one: So, the known folder values that recent code is using such as FOLDERID_ProgramData, FOLDERID_LocalAppData, and FOLDERID_Profile are being declared as external constants. That is why the error is a link error. We need to include -luuid on the link command line because those external constants are defined in uuid.lib. --- sys/winnt/Makefile.gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 0dce1f176..54a14572e 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -510,7 +510,7 @@ endif CFLAGSBASE = -c $(cflags) $(WINPINC) $(cdebug) $(CURSESDEF) #LFLAGSBASEC = $(linkdebug) #LFLAGSBASEG = $(linkdebug) -mwindows -baselibs = -lwinmm -lshell32 -lole32 +baselibs = -lwinmm -lshell32 -lole32 -luuid conlibs = -lgdi32 $(baselibs) $(BCRYPT) guilibs = -lcomctl32 $(baselibs) ifeq "$(WANT_WIN_QT4)" "Y"