Opened 9 years ago

Closed 9 years ago

Last modified 7 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
Cc:

Description

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 http://trac.osgeo.org/postgis/wiki/DevWikiWinMingWSys_20 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 http://osgeo-org.1803224.n2.nabble.com/gdal-dev-Unable-to-link-gdal-CPLCreateOrAcquireMutex-reference-not-found-td7073804.html

Change History (4)

comment:1 Changed 9 years ago by Even Rouault

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 */
+#  undef  CPL_MULTIPROC_PTHREAD
 #endif
 
 #if !defined(CPL_MULTIPROC_WIN32) && !defined(CPL_MULTIPROC_PTHREAD) \

comment:2 Changed 9 years ago by realityexists

That fixes it, thank you!

comment:3 Changed 9 years ago by Even Rouault

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 Changed 7 years ago by Even Rouault

Milestone: 1.8.2

Milestone 1.8.2 deleted

Note: See TracTickets for help on using tickets.