List:MySQL++« Previous MessageNext Message »
From:Viktor Stark Date:December 21 2005 9:15am
Subject:[patch] SSQLS linking problem
View as plain text  

The issue has been raised a few times already on the list, IIRC.
Just a little reminder:
- Create dbHandling.h (class definition) and dbHandling.cpp (member function
- If you are using sql_create_# macros, and you include dbHandling.h in
another file, you'll get linking conflicts (namely on ::_table and ::names).

To solve that issue, needs a small modification so that it
generates a custom-macros.h which only defines ::_table and ::names once.

There is a small quick-n-dirty patch attached.
Apply with: patch -p0 < ssqls-link.patch
Then run:

You'll now have a new custom-macros.h. 
If you dont want the static members to be defined in a file, then just:
Don't forget that you need the static members to be defined at some point
(but only *once*).

Just a note: this has been tested only under Debian unstable/FC4. I have no
access to Windows development machines. Any feedback on different
architectures is welcome.

Hope some people will find this useful.


10 GB Mailbox, 100 FreeSMS/Monat
+++ GMX - die erste Adresse f---	2005-12-20 14:31:41.000000000 +0100
+++	2005-12-21 09:56:19.000000000 +0100
@@ -56,6 +56,12 @@
 #include <string>
+#define MYSQLPP_SSQLS_EXPAND(a...) a
 namespace mysqlpp {
 enum sql_dummy_type {sql_dummy};
@@ -635,11 +641,11 @@
     NAME##_cus_equal_list<Manip> equal_list(mysqlpp::cchar *d, mysqlpp::cchar *c, Manip m, 
 					    mysqlpp::sql_cmp_type sc) const;
   const char *NAME::names[] = { 
-  const char *NAME::_table = #NAME ;  
+  const char *NAME::_table = #NAME ;)
   template <class Manip>
[patch] SSQLS linking problemViktor Stark21 Dec
  • Re: [patch] SSQLS linking problemWarren Young21 Dec
  • Re: [patch] SSQLS linking problemWarren Young4 Mar