So I've been struggling with getting the v2.0 compiled on my
win32/cygwin build environment for about a week now, and decided that I
couldn't figure it out on my own. I've spent hours trying to get the dang
thing to work correctly, and just can't seem to make it work. I've searched
the mailing list archives but haven't found anything useful (yet - I will,
of course, as soon as I send this post find the perfect post to solve my
problems). The end desired product is to somehow link this into a project
that is being developed using Eclipse - but for now I just want it to work
after building it in the old 'configure', 'make', 'make install' way (saw
Warren's post on this last month so I won't make that mistake).
When I first downloaded the library I built it in Visual Studio in
about 2 minutes. Generated the release and debug dlls no problem, including
their appropriate "Exports Library File" and "C/C++ Inline File" - although
I can't find anyone who will tell me the difference between an Exports
Library File and Import Library File or what the purpose of the C/C++ Inline
File is (this probably gives me away as a newbie if my subject line didn't
Then, pumped that everything was gonna work perfectly, went to build
it in cygwin, under bash. Alas, the configure script died when it got to
looking for the mysql client library business. I realized I had mysql
installed in an unusual location: C:\Program Files\MySQL\ or
/cygdrive/c/Program\ Files/, but it still wouldn't find those libraries even
after I put that path in (using the --with-mysql, --with-mysql-lib, and
Frustrated, I turned to the MySQL++ website and read the section on
how to twist MySQL++'s arm to get it to build under cygwin. I appreciate
whoever put that short description and links on how to do what he was
talking about up there, but it seems to be missing a few things, or perhaps
just outdated. First, the native windows installation no longer (if it ever
did) contains any dll with the word "client" in it, second it would be nice
for it to note somewhere that configure can't handle a path with a space in
it, no matter how many escapes you put on it (I recall running 'configure'
with the --with-mysql-lib=/cygdrive/c/Program\\\ Files/MySQL/lib/opt switch
at one point). So I followed the directions on the website on using
pexports to generate a definitions file, then using dlltool to generate an
import library '.a' file off the native dll (the only one I had in my mySQL
lib/opt directory was 'libmySQL.dll'). There is a mysqlclient.lib file that
I have no idea what could be used for, but at least has the word 'client' in
it. Once I had accomplished this, I had in my MySQL/lib/opt directory
'libmySQL.dll' and 'libmySQL.a' files - without pexports or dlltool
reporting to me that anything had gone awry. Trying configure yet again, it
still could not find the client library, so I copied and renamed both files
to 'libmysqlclient.dll' and 'libmysqlclient.a'. No dice. Copied everything
in the library directory to a path without spaces (now it is:
/cygdrive/c/mysql/lib/opt). Worked! Of course, had to copy the include files
there as well (/cygdrive/c/mysql/include), since (as I mentioned before)
configure can't seem to function with spaces in the path (snide comment that
it is SO 1990's for a program not to be able to handle spaces). So it
compiled and built all those examples just as I knew it could!
Re-animated about the possibility of achieving the initial goal
(using it in the Eclipse project), I grabbed the .a file I had used to get
the mysql++.dll to compile and added it to the test project I was working on
(in Eclipse). Compiled and built, no more linker errors! Unfortunately, my
hopes were dashed as when I tried to run the program it segfaulted as soon
as it got to the first MySQL++ object (a mysqlpp::Connection type object).
So, I went back to the examples and everyone of them segfaults as well.
Thinking maybe it was a "can't find the dll" segfault, I copied all the dlls
I had to the C:\Windows\System32 directory (in my PATH environment
variable). The dlls I copied were: libmySQL.dll, it's copy
libmysqlclient.dll, and mysql++.dll (freshly successfully? compiled).
At wits end, with no where to go.
Anyone got any ideas?