List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:August 4 2005 6:14pm
Subject:Re: Cygwin/Win32/V2.0beta/library help! (MySQLC++ newbie)
View as plain text  
Warren Young wrote:
> for now, you're going to have to force it to use static libraries, 

I've been chasing this on the Cygwin mailing list.  Some kind folk there 
have given me the clues necessary to get the library building using 
shared objects.  It even runs, for a sufficiently restricted definition 
of "runs".

First, you need to build MySQL from source.  I had the best luck with 
4.1.  You must give the "--without-server" configure flag, because a) 
you only need the client libraries; and b) the server doesn't build 
correctly under Cygwin anyway.  Say "make install" once it's built.

Second, you need to go into /usr/local/lib/mysql (assuming you let it 
install in the default location) and give this monster of a command:

gcc -shared -o cygmysqlclient-4.1.13.dll \
  -Wl,--out-implib=libmysqlclient.dll.a -Wl,--export-all-symbols \
  -Wl,--enable-auto-import -Wl,--whole-archive libmysqlclient.a \
  -Wl,--no-whole-archive -lcrypt -lz

Then, apply the attached patch to MySQL++.

Having applied that, you will need to run MySQL++'s bootstrap script. 
Partly this integrates the patch changes, and partly it updates the 
tarball versions of scripts like libtool with Cygwin-aware versions.

Finally, you're ready to build MySQL++.  It should build just fine.  But 
you'll find that the example programs hang, hard.  Simple1, for 
instance, hangs on line 199 of examples/util.cpp, during a return from 
Query::store(const char*)!  I think there's some compiler or binutils 
type of problem here, but I could be wrong.

I'm posting this saga in case someone (Patrick?) wants to try debugging 
this further.  Me, I'm finished unless someone else comes up with 
something.  I've fought this damned thing for days now, and I don't even 
use Cygwin for this.  Time to move on.

"program, vt.: To engage in a pastime similar to banging one's head 
against a wall, but with fewer opportunies for reward." -- The Jargon File

---	(revision 1000)
+++	(working copy)
@@ -1,4 +1,4 @@
 INCLUDES = -I$(top_srcdir)/lib
-LIBS = -lz -l@MYSQL_C_LIB@
+LIBS = -lz -lmysqlclient.dll
 MYSQLPP_LIB = $(top_builddir)/lib/
Index: lib/
--- lib/	(revision 1000)
+++ lib/	(working copy)
@@ -22,7 +22,7 @@
-libmysqlpp_la_LDFLAGS=-version-info @MYSQLPP_LIBTOOL_VERSION@
+libmysqlpp_la_LDFLAGS=-version-info @MYSQLPP_LIBTOOL_VERSION@ -no-undefined
 libmysqlpp_la_SOURCES = \
 	coldata.cpp connection.cpp datetime.cpp fields.cpp field_names.cpp \

Cygwin/Win32/V2.0beta/library help! (MySQLC++ newbie)Patrick McMichael1 Aug
  • Re: Cygwin/Win32/V2.0beta/library help! (MySQLC++ newbie)Warren Young1 Aug
    • RE: Cygwin/Win32/V2.0beta/library help! (MySQLC++ newbie)Patrick McMichael3 Aug
      • Re: Cygwin/Win32/V2.0beta/library help! (MySQLC++ newbie)Warren Young3 Aug
        • Re: Cygwin/Win32/V2.0beta/library help! (MySQLC++ newbie)Warren Young4 Aug