Skip to contentSkip to conversation

./configure: use -lole32 when building with mingw32

PATCH In review Meador Inge 4 participants 5 messages Feb 15, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ./configure: use -lole32 when building with mingw32

glib calls 'CoTaskMemFree' which is defined by ole32.dll. Therefore when building with mingw32 -lole32 should be in 'LIBS'.

---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 88521d2..40caf81 100755
@@ -502,7 +502,7 @@ if test "$mingw32" = "yes" ; then
   QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
   # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
   QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
-  LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS"
+  LIBS="-lole32 -lwinmm -lws2_32 -liberty -liphlpapi $LIBS"
   prefix="c:/Program Files/Qemu"
   mandir="\${prefix}"
   datadir="\${prefix}"
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 3 lines · Meador Inge

glib calls 'CoTaskMemFree' which is defined by ole32.dll. Therefore when building with mingw32 -lole32 should be in 'LIBS'.

Not that I'm objecting to the patch, but isn't this technically a bug in the pkg-config for glib with mingw32 that we're working around?

-- PMM

#2 lore raw
Quoted 6 lines · Peter Maydell
Quoted 3 lines

glib calls 'CoTaskMemFree' which is defined by ole32.dll.

Quoted 2 lines

Therefore when building with mingw32 -lole32 should be in 'LIBS'.

Not that I'm objecting to the patch, but isn't this technically a bug in the pkg-config for glib with mingw32 that we're working around?

Yes, and I object to the patch. :)

Paolo

#3 lore raw
In reply to Peter Maydell
Quoted 8 lines · Peter Maydell
Quoted 3 lines · Meador Inge

glib calls 'CoTaskMemFree' which is defined by ole32.dll. Therefore when building with mingw32 -lole32 should be in 'LIBS'.

Not that I'm objecting to the patch, but isn't this technically a bug in the pkg-config for glib with mingw32 that we're working around?

Yup, the issue is fixed in recent versions of glib:

http://git.gnome.org/browse/glib/commit/?id=b79eae5c197aeec8d57f39c0f7bf5d5114068bea

http://git.gnome.org/browse/glib/commit/?id=5377c0de0108d292ea3e23fa6d90410f9ac9fa00

I am OK with backporting the glib fix for mingw32 builds. Sorry for the noise.

Signature · 3 lines
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software
#4 lore raw
In reply to Meador Inge

Am 15.02.2012 17:41, schrieb Meador Inge:

Quoted 15 lines

glib calls 'CoTaskMemFree' which is defined by ole32.dll. Therefore when building with mingw32 -lole32 should be in 'LIBS'.

---
configure | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
configure +0 -0
index 88521d2..40caf81 100755
@@ -502,7 +502,7 @@ if test "$mingw32" = "yes" ; then

QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"

Quoted 7 lines
# enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
- LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS"
+ LIBS="-lole32 -lwinmm -lws2_32 -liberty -liphlpapi $LIBS"
prefix="c:/Program Files/Qemu"
mandir="\${prefix}"
datadir="\${prefix}"

Hi,

this would be a workaround for a bug in glib-2.0. If it requires ole32.dll, it should add it to glib-2.0.pc, so pkg-config will add it to QEMU.

I never had problems caused by a missing ole32.dll. Which MinGW do you use (native, cross, version), and where did you get your glib-2.0 from? My glib-2.0 has no reference to CoTaskMemFree.

Regards,

Stefan Weil