From: Warren Young Date: December 20 2006 6:20pm Subject: Re: help... how do i use SSQLS within my own classes... List-Archive: http://lists.mysql.com/plusplus/6199 Message-Id: <45897EEF.7060302@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit joh3@stripped wrote: > > /tmp/ccc67q0l.o:/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/iostream:78: > multiple definition of `Target_Region::_table' Every SSQLS type includes two static member variables; _table is one. If you don't do anything to avoid it, they're assigned default values within the sql_create_* macro, so if the compiler sees that macro call twice, it sees two separate assignments to a static member variable, which annoys it. To fix this, I would put the sql_create_* macro in a separate .h file, and #define MYSQLPP_SSQLS_NO_STATICS above all #includes for that file except for one. This ensures that the static members are assigned to only once. You can see this pattern in action in the examples: the 'stock' SSQLS type is defined in stock.h, and it is included in both util.cpp and in custom*.cpp. Your situation is slightly more complex because you are #including the SSQLS definition within a .h file. You'll probably need a little C preprocessor work to avoid problems here. > also i need to extend the mysql++ library to use the geospatial mysql > extensions, i am slowly working out how mysql++ all fits together, would you > like patches to make them work if i can get it working? Simple patches like this usually get accepted pretty quickly. I suggest looking at lib/sql_types.h. > should they be against the svn code or the base mysql++ 2.1.1 code? Against svn, if at all possible. That makes it easier for you to generate diffs, and for me to apply them.