Author: wyoung
Date: Fri Jan 12 12:41:25 2007
New Revision: 1386
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1386&view=rev
Log:
resetdb example now checks that its headers come from the same version
of MySQL++ as its library. Only bothering to do it here, as you have to
run resetdb before any of the other popular examples.
Modified:
trunk/README.examples
trunk/Wishlist
trunk/examples/resetdb.cpp
Modified: trunk/README.examples
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/README.examples?rev=1386&r1=1385&r2=1386&view=diff
==============================================================================
--- trunk/README.examples (original)
+++ trunk/README.examples Fri Jan 12 12:41:25 2007
@@ -19,7 +19,7 @@
Start with resetdb:
- $ ./resetdb [host] [user] [password] [port]
+ $ ./exrun resetdb [host] [user] [password] [port]
This sets up the mysql_cpp_data database used by most of the
other examples.
@@ -28,6 +28,14 @@
be in that order. That is, if you want to give a user name,
you must give the host first. It defaults to localhost with
your user name, no password, and the default MySQL port (3306).
+
+ The exrun wrapper script ensures that your system's dynamic
+ linker doesn't mistakenly use the installed MySQL++ library
+ with programs linked against a different version of the
+ MySQL++ header files. This is easy to do if you have one
+ version of MySQL++ already installed, and are trying to build
+ a new version. resetdb double-checks this, and reports an
+ error if it detects a mismatch.
The following examples use the database set up by resetdb,
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1386&r1=1385&r2=1386&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Fri Jan 12 12:41:25 2007
@@ -20,12 +20,6 @@
o Test that it still works under MinGW after the recent
DLL linkage fixes for VC++.
-
- o Add function to library to return its version number in a
- structured form. Then, make resetdb query it to ensure that
- it's linked to the same version. Prevents errors caused
- by not using exrun script when running examples with a
- different library version installed.
o Not building on Intel Mac, possbly due to move away from libtool?
Modified: trunk/examples/resetdb.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/resetdb.cpp?rev=1386&r1=1385&r2=1386&view=diff
==============================================================================
--- trunk/examples/resetdb.cpp (original)
+++ trunk/examples/resetdb.cpp Fri Jan 12 12:41:25 2007
@@ -38,6 +38,16 @@
int
main(int argc, char *argv[])
{
+ // Ensure that we're not mixing library and header file versions.
+ // This is really easy to do if you have MySQL++ on your system and
+ // are trying to build a new version, and run the examples directly
+ // instead of through exrun.
+ if (mysqlpp::get_library_version() != MYSQLPP_HEADER_VERSION) {
+ cerr << "Library/header version number mismatch. Are you" <<
endl;
+ cerr << "using exrun to run this? See README.examples." <<
endl;
+ return 1;
+ }
+
// Connect to database server
mysqlpp::Connection con;
try {
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits