MySQL Forums
Forum List  »  Connector/C++

Mysql++ using SSQLS within a class
Posted by: Jim Lynch
Date: December 16, 2007 01:12PM

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.

Options: ReplyQuote


Subject
Views
Written By
Posted
Mysql++ using SSQLS within a class
5030
December 16, 2007 01:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.