Tue 14 Dec 2010 04:31:48 PM UTC, original submission:
When building MySQL++ with SunStudio 12.2 compiler on both Solaris 10 for Sparc and Solaris 11 Express for Sparc with the following message:
/home/ahulsbos/scratch/src/mysqlpp/bk-deps CC -c -o mysqlpp_connection.o -I. -KPIC -DPIC -I/opt/pd/mysql5/include -g ./lib/connection.cpp
"./lib/null.h", line 174: Error: In this declaration "data" is of an incomplete type "mysqlpp::String".
"./lib/qparms.h", line 102: Where: While specializing "mysqlpp::Null<mysqlpp::String, mysqlpp::NullIsNull>".
"./lib/qparms.h", line 102: Where: Specialized in non-template code.
1 Error(s) detected.
The issue can be fixed by moving the definition of 'SQLTypeAdapter& SQLQueryParms::operator [](size_type n)' from the header file 'qparms.h' to 'qparms.cpp' file. The following patches implement the fix:
Index: lib/qparms.h
===================================================================
--- lib/qparms.h (revision 2680)
+++ lib/qparms.h (working copy)
@@ -96,13 +96,7 @@
size_t length) const;
/// \brief Access element number n
- SQLTypeAdapter& operator [](size_type n)
- {
- if (n >= size()) {
- insert(end(), (n + 1) - size(), "");
- }
- return std::vector<SQLTypeAdapter>::operator [](n);
- }
+ SQLTypeAdapter& operator [](size_type n);
/// \brief Access element number n
const SQLTypeAdapter& operator [](size_type n) const
Index: lib/qparms.cpp
===================================================================
--- lib/qparms.cpp (revision 2680)
+++ lib/qparms.cpp (working copy)
@@ -47,6 +47,16 @@
}
SQLTypeAdapter&
+SQLQueryParms::operator [](size_type n)
+{
+ if (n >= size()) {
+ insert(end(), (n + 1) - size(), "");
+ }
+ return std::vector<SQLTypeAdapter>::operator [](n);
+}
+
+
+SQLTypeAdapter&
SQLQueryParms::operator [](const char* str)
{
if (parent_) {
|