I'm attempting to use the specialize SQL structures as described at
http://tangentsoft.net/mysql++/doc/html/userman/ssqls.html however when I include the macro in my class definition it gets errors like:
loggerbase.h:216: error: a brace-enclosed initializer is not allowed here before '{' token
loggerbase.h:216: error: cannot declare member `LoggerBase::csuStruct::names' within `LoggerBase'
loggerbase.h:216: error: cannot declare member `LoggerBase::csuStruct::_table' within `LoggerBase'
loggerbase.h:216: error: cannot declare member function `LoggerBase::csuStruct_cus_value_list<Manip>::csuStruct_cus_value_list' within `LoggerBase'
(and on for a couple of pages)
The macro looks like:
sql_create_18( csuStruct, 1, 0,
string, user_id,
string, username,
string, password,
string, site_name,
...
string, random)
If I move it out of the class definition then it compiles OK but I get the following:
loggerbase.o(.data+0x8):/usr/local/include/mysql++/lockable.h:133: multiple definition of `csuStruct::_table'
Plus a few other similar messages. It looks like it's doing more than defining a structure.
If I try to embed it in my cpp code, I get:
loggerbase.cpp: In member function `void LoggerBase::init()':
loggerbase.cpp:285: error: expected primary-expression before "template"
loggerbase.cpp:285: error: expected `;' before "template"
loggerbase.cpp:285: error: expected primary-expression before "template"
So it looks like SSQLS is only useful in the very simplest case where there is only one file.
Can anyone shed some light on how I might use this feature? If this is the wrong place to ask, please let me know where a better one might be.
Thanks,
Jim.