Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#4430 closed defect (fixed)

Windows build error: undefined reference to `CPLCreateOrAcquireMutex'

Reported by: realityexists Owned by: warmerdam
Priority: normal Milestone:
Component: ConfigBuild Version: 1.8.1
Severity: major Keywords: mingw pthread


Building on Windows XP x64 with 32-bit MinGW I get the following error:

c:\projects\gdal\gdal-1.8.1\port/cpl_multiproc.cpp:73: undefined reference to `CPLCreateOrAcquireMutex'

I'm building following the instructions at so the configure command was:

./configure --without-libtool --with-libtiff=internal --with-libz=/c/gtkbundle --prefix=/c/projects/gdal/rel-trunk

Others seem to have run into this as well - see

Change History (4)

comment:1 by Even Rouault, 11 years ago

Could you try the following fix in port/cpl_multiproc.h

Index: port/cpl_multiproc.h
--- port/cpl_multiproc.h	(revision 23708)
+++ port/cpl_multiproc.h	(working copy)
@@ -41,6 +41,9 @@
 #if defined(WIN32) && !defined(CPL_MULTIPROC_STUB)
 #  define CPL_MULTIPROC_WIN32
+/* MinGW can have pthread support, so disable it to avoid issues */
+/* in cpl_multiproc.cpp */
 #if !defined(CPL_MULTIPROC_WIN32) && !defined(CPL_MULTIPROC_PTHREAD) \

comment:2 by realityexists, 11 years ago

That fixes it, thank you!

comment:3 by Even Rouault, 11 years ago

Component: defaultConfigBuild
Keywords: mingw pthread added
Milestone: 1.8.2
Resolution: fixed
Status: newclosed

Fixed in trunk (r23728), branches/1.9 (r23729) and branches/1.8 (r23730)

comment:4 by Even Rouault, 9 years ago

Milestone: 1.8.2

Milestone 1.8.2 deleted

Note: See TracTickets for help on using tickets.