On Jul 21, 2008, at 12:29 AM, Amit k. Saha wrote:
> ./lib/beemutex.cpp:43: error: `mutex_t' does not name a type
Okay, this is the real error. And wouldn't you know it, it is
particular to beemutex.cpp: it's getting faked out by the fact that
you have both synch.h on your system as well as pthreads.
Lacking a Solaris machine here, I'm going to have to guess at the
fix. Try this patch, or check out the current svn version of MySQL++
and try that:
Index: configure.ac
===================================================================
--- configure.ac (revision 2303)
+++ configure.ac (working copy)
@@ -48,13 +48,13 @@
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
+ AC_CHECK_HEADERS(synch.h)
fi
# Checks for libraries and local system features
AC_CHECK_HEADERS(zlib.h, AC_CHECK_LIB(z, gzread, [],
[ AC_MSG_ERROR([zlib is required]) ]))
-AC_CHECK_HEADERS(synch.h)
LIB_MATH
LIB_SOCKET_NSL
MYSQL_API_LOCATION
Index: lib/beemutex.cpp
===================================================================
--- lib/beemutex.cpp (revision 2303)
+++ lib/beemutex.cpp (working copy)
@@ -39,10 +39,11 @@
namespace mysqlpp {
#define ACTUALLY_DOES_SOMETHING
-#if defined(HAVE_SYNCH_H)
+#if defined(HAVE_PTHREAD)
+ typedef pthread_mutex_t bc_mutex_t;
+#elif defined(HAVE_SYNCH_H)
+# include <synch.h>
typedef mutex_t bc_mutex_t;
-#elif defined(HAVE_PTHREAD)
- typedef pthread_mutex_t bc_mutex_t;
#elif defined(MYSQLPP_PLATFORM_WINDOWS)
typedef HANDLE bc_mutex_t;
#else
Basically, it's taking the pthread path before the synch.h path.
Also, I've disabled the synch.h test when we're not interested in
thread support, as in your case, so it won't try to build the beemutex
stuff at all.