lamuguo / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Error compiling re2 on mingw with NO_THREADS option #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi!

I'm trying building re2-20140304 on windows, using mingw (gcc 4.8.1).
On a normal build everything is fine (apart pthreads linking in shared object 
creation, but I don't need shared library so simply disabled it).
When I try doing the following, to build without pthread support:

export CXXFLAGS="-DNO_THREADS -O3"
make

i get a build error in regexp.cc because the GLOBAL_MUTEX() macro expands to a 
pthreads mutex definition.

I have corrected that thing by changing line 189 in util\mutex.h from:
#ifdef HAVE_PTHREAD
to
#if defined(HAVE_PTHREAD) && !defined(NO_THREADS)

This solves the build error, infact I get a library that has no pthread symbol 
defined in it.

Original issue reported on code.google.com by thepy...@gmail.com on 9 Apr 2014 at 7:34

GoogleCodeExporter commented 9 years ago
RE2 has moved to GitHub. I have not moved the issues over. If this issue is 
still important to you, please file a new one at 
https://github.com/google/re2/issues. Thank you.

Original comment by rsc@golang.org on 11 Dec 2014 at 4:45