From 409b56b60c0ac38933bbce3eeb67deef2be0a668 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 22 Feb 2014 15:34:31 -0800 Subject: [PATCH] Fixed bug 2298 - undefined reference to `IID_IUnknown' on cygwin Brian Minton When building static or shared libraries on cygwin 1.7.25 on Windows 7 (32-bit), I get the following link errors: build/.libs/SDL_windowskeyboard.o: In function `UIElementSink_QueryInterface@12': /home/c-bminton/src/SDL/src/video/windows/SDL_windowskeyboard.c:995: undefined reference to `IID_IUnknown' build/.libs/SDL_windowskeyboard.o: In function `IPPASink_QueryInterface@12': /home/c-bminton/src/SDL/src/video/windows/SDL_windowskeyboard.c:1101: undefined reference to `IID_IUnknown' collect2: error: ld returned 1 exit status Makefile:126: recipe for target 'build/libSDL2.la' failed make: *** [build/libSDL2.la] Error 1 -- The libuuid from e2fsprogs is completely unrelated to the w32api UUID.DLL implib. FWIW, any *NIX software that I've seen obviously wants the e2fsprogs version, but if libuuid-devel is installed (in /usr/lib) then you can't link against the w32api implib with a simple -luuid. --- configure | 7 ++++++- configure.in | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ccb585e25..be5648476 100755 --- a/configure +++ b/configure @@ -22808,7 +22808,12 @@ $as_echo "#define SDL_LOADSO_WINDOWS 1" >>confdefs.h have_loadso=yes fi # Set up the system libraries we need - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc" + if -f /lib/w32api/libuuid.a ; then + LIBUUID=/lib/w32api/libuuid.a + else + LIBUUID=-luuid + fi + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -XCClinker -static-libgcc" # The Windows platform requires special setup VERSION_SOURCES="$srcdir/src/main/windows/*.rc" SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" diff --git a/configure.in b/configure.in index 3c7adcba1..2decb1373 100644 --- a/configure.in +++ b/configure.in @@ -2860,7 +2860,12 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau have_loadso=yes fi # Set up the system libraries we need - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc" + if [ -f /lib/w32api/libuuid.a ]; then + LIBUUID=/lib/w32api/libuuid.a + else + LIBUUID=-luuid + fi + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion $LIBUUID -XCClinker -static-libgcc" # The Windows platform requires special setup VERSION_SOURCES="$srcdir/src/main/windows/*.rc" SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"