It's taken me a while, but I've got round to getting the latest
version out of svn and getting it to compile on Windows. I had a couple of
minor problems which I'll supply patches for, but there's an issue with
exporting classes that I wanted your thoughts on.
If you turn the warning level up to 3, you get a bunch of warnings
similar to:
...\connection.h(570) : warning C4251:
'mysqlpp::Connection::pending_options_' : class 'std::deque<_Ty>' needs to
have dll-interface to be used by clients of class 'mysqlpp::Connection'
with
[
_Ty=mysqlpp::Connection::OptionInfo
]
See http://msdn2.microsoft.com/en-us/library/esew7y1w.aspx for
warning details. This basically is warning that the stl class
instantiations in the mysqlpp exported classes haven't been exported from
the dll. I'm not sure what the effects of not exporting the stl classes
are, but my best guess is that private members are ok, but classes derived
from stl classes or that have public / protected members should be exported.
There are a couple of solutions, disable the warning or export the
classes as described here
http://support.microsoft.com/default.aspx?scid=kb;en-us;168958 . There's
only one problem with that solution, apparently it's not possible to export
some of the classes as they rely on other non-exported classes. In fact the
only container class you can export is vector<xxx>.
I also found this page, where someone had the same problem and
discussed the solutions they'd found
http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html . Anyone
know the correct thing to do?
Cheers,
Matt.
-----Original Message-----
From: Warren Young [mailto:mysqlpp@stripped]
Sent: 11 October 2006 23:47
To: MySQL++ Mailing List
Subject: Re: mysql++ memory usage
It sounds like you're in an excellent position to supply a patch. ;)
Please make it against svn (as opposed to 2.1.1), so it's easy for me to
evaluate, merge and test.