List:MySQL++« Previous MessageNext Message »
From:Wolfram Arnold Date:July 6 2005 3:23pm
Subject:Re: static globals in SSQL macro expansion -> multiple definition
linker errors
View as plain text  
Thanks for that suggestion, Chris.  I'll play with it.

-Wolfram

On Wed, 2005-07-06 at 06:39 -0400, Chris Frey wrote:
> On Wed, Jul 06, 2005 at 01:15:33AM -0700, Wolfram Arnold wrote:
> > Could the macro be split into two or take an extra flag to optionally
> > not generate the definition for the globals?  I'd be glad to give this a
> > shot, but I wanted to hear from the community if there is any reason
> > other than lack of volunteers.  This has come up before; I found mailing
> > list articles as far back as 2001 on this.
> 
> Personally, I'd say go for it.  Keeping all the logic in one macro / header
> (i.e. custom-macros.h) is probably the most maintenance friendly, since the
> macro needs to be expanded for the names anyway, and you don't want to
> duplicate it anywhere.
> 
> Something like this might be useful:
> 
> // file: tables.h - define it
> sql_create_5(stock, ..... );
> 
> // file: stock.cpp - the only file that has the static data
> #define SSQLS_GENERATE_STATICS
> #include "tables.h"
> 
> // file: client.cpp - simple user module
> #include "tables.h"
> 
> 
> Might take some creativity to do that, but I think it's possible.
> 
> - Chris
> 
> 
-- 
Wolfram Arnold <wolfram@stripped>

Thread
static globals in SSQL macro expansion -> multiple definitionlinker errorsWolfram Arnold6 Jul
  • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey6 Jul
    • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWolfram Arnold6 Jul
    • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young6 Jul
      • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey6 Jul
        • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young6 Jul
          • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey7 Jul
            • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young7 Jul
              • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey8 Jul
                • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young8 Jul
              • Unresolved External SymbolBrian Farmer14 Jul
                • Re: Unresolved External SymbolWarren Young14 Jul
                • Connection always on and field namesAnkur G35 Saxena17 Jul
                  • Re: Connection always on and field namesWarren Young18 Jul
  • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young6 Jul