List:MySQL++« Previous MessageNext Message »
From:Simon Pickles Date:December 12 2007 10:16pm
Subject:Linking errors after moving to SSQLSs, macro problem
View as plain text  
Hi,

My app was building and running without using SSQLS, but seeing the 
simplicity and extra functionality they afford, I moved to SSQLS. 
Unfortunately, this generates a string of linker errors now, due to 
multiple definitions.

This is, I think, because I have declared the SSQLS using a macro in a 
header file. To use the resulting data structure I have been including 
the header file, but this runs the macro repeatedly of course.

Eg:

#ifndef DATABASESTRUCTS_H
#define DATABASESTRUCTS_H

#include <mysql++.h>
#include <custom.h>

sql_create_4(    PlayerSQL,         1, 0,
                unsigned int,     PLAYER_ID,
                std::string,     PLAYER_NAME,
                unsigned int,     PLAYER_OBJECTID,
                unsigned int,     PLAYER_ZONE );
#endif

What is the correct way to overcome this? I need PlayerManager.cpp and 
Player.cpp to have PlayerSQL in scope.

Thanks

Simon

-- 
Linux user #458601 - http://counter.li.org.



Thread
Linking errors after moving to SSQLSs, macro problemSimon Pickles12 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemWilliam F. Dowling12 Dec
Re: Linking errors after moving to SSQLSs, macro problemWarren Young12 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemSimon Pickles16 Dec
Re: Linking errors after moving to SSQLSs, macro problemWarren Young17 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemSimon Pickles17 Dec
Re: Linking errors after moving to SSQLSs, macro problemWarren Young17 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemSimon Pickles17 Dec
RE: Linking errors after moving to SSQLSs, macro problemJoel Fielder17 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemDrew M.18 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemSimon Pickles18 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemWarren Young18 Dec
    • Re: Linking errors after moving to SSQLSs, macro problemJim19 Dec
      • Re: Linking errors after moving to SSQLSs, macro problemWarren Young19 Dec
        • Re: Linking errors after moving to SSQLSs, macro problemJim20 Dec
          • Re: Linking errors after moving to SSQLSs, macro problemWarren Young21 Dec
Re: Linking errors after moving to SSQLSs, macro problemWarren Young18 Dec
  • Re: Linking errors after moving to SSQLSs, macro problemWarren Young18 Dec
    • Re: Linking errors after moving to SSQLSs, macro problemSimon Pickles18 Dec
Re: Linking errors after moving to SSQLSs, macro problemWarren Young18 Dec