| View previous topic :: View next topic |
| Author |
Message |
Dennis Cote Guest
|
Posted: Fri Apr 27, 2007 9:15 pm Post subject: compiler error prevents using current sqlite versions |
|
|
Hi All,
I have recently run into a problem with the C++ compiler in BDS 2006. It
generates an E2232 error when trying to build a project using a recent
version of SQLite, a popular embedded SQL database engine.
SQLite is a C program. I can compile the C source and generate a library
file. The problem occurs when I try to include its header file into a
C++ project to use the SQLite API functions.
Since June of 2006 the SQLite header file has included the following
struct definition:
struct sqlite3_index_info {
/* Inputs */
const int nConstraint; /* Number of entries in aConstraint */
const struct sqlite3_index_constraint {
int iColumn; /* Column on left-hand side of constraint */
unsigned char op; /* Constraint operator */
unsigned char usable; /* True if this constraint is usable */
int iTermOffset; /* Used internally - xBestIndex should
ignore */
} *const aConstraint; /* Table of WHERE clause constraints */
const int nOrderBy; /* Number of terms in the ORDER BY clause */
const struct sqlite3_index_orderby {
int iColumn; /* Column number */
unsigned char desc; /* True for DESC. False for ASC. */
} *const aOrderBy; /* The ORDER BY clause */
/* Outputs */
struct sqlite3_index_constraint_usage {
int argvIndex; /* if >0, constraint is part of argv to
xFilter */
unsigned char omit; /* Do not code a test for this constraint */
} *const aConstraintUsage;
int idxNum; /* Number used to identify the index */
char *idxStr; /* String, possibly obtained from
sqlite3_malloc */
int needToFreeIdxStr; /* Free idxStr using sqlite3_free() if true */
int orderByConsumed; /* True if output is already ordered */
double estimatedCost; /* Estimated cost of using this index */
};
These structures are only ever created by the SQLite library's C code.
SQLite then passes a pointer to one of these structures to a user
supplied function as its second argument.
int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
When included into a C++ compilation by includeing the sqlite3.h file
this struct definition causes the Borland/CodeGear C++ compiler to
generate the following errors:
[C++ Error] sqlite3.h(1778): E2232 Constant member
'sqlite3_index_info::nConstraint' in class without constructors
[C++ Error] sqlite3.h(1778): E2232 Constant member
'sqlite3_index_info::aConstraint' in class without constructors
[C++ Error] sqlite3.h(1778): E2232 Constant member
'sqlite3_index_info::nOrderBy' in class without constructors
[C++ Error] sqlite3.h(1778): E2232 Constant member
'sqlite3_index_info::aOrderBy' in class without constructors
[C++ Error] sqlite3.h(1778): E2232 Constant member
'sqlite3_index_info::aConstraintUsage' in class without constructors
This compiler error was discussed on this list several years ago
http://groups.google.ca/group/borland.public.cppbuilder.language/browse_frm/thread/4de71094ad6b5044/27e1091f1949cd0f?lnk=st&q=Borland+E2232&rnum=9&hl=en#
and Greg Comeau concluded that it was not a valid error.
He said that for a structure containing only POD (plain old data) types
such as this one, no constructor should be required. In this case one is
clearly not needed.
This incorrect error prevents using current versions of SQLite in C++
programs with BDS 2006.
The *standard* SQLite header file is currently used successfully in C++
projects compiled by both the G++ and VC++ compilers.
What needs to be done to get this problem corrected in BC++?
Dennis Cote |
|
| Back to top |
|
 |
Bob Gonder Guest
|
Posted: Sat Apr 28, 2007 7:30 pm Post subject: Re: compiler error prevents using current sqlite versions |
|
|
Dennis Cote wrote:
| Quote: | This compiler error was discussed on this list several years ago
|
It was also recently discussed.
| Quote: | What needs to be done to get this problem corrected in BC++?
|
The upshot was to modify the headers.
As you know, this is in QC as 32959 and was opened 01/08/2007
| Quote: | What needs to be done to get this problem corrected in BC++?
|
Put some votes on it? |
|
| Back to top |
|
 |
Dennis Cote Guest
|
Posted: Mon Apr 30, 2007 7:41 pm Post subject: Re: compiler error prevents using current sqlite versions |
|
|
Bob Gonder wrote:
| Quote: | Dennis Cote wrote:
This compiler error was discussed on this list several years ago
It was also recently discussed.
|
Do you have a link?
| Quote: | What needs to be done to get this problem corrected in BC++?
The upshot was to modify the headers.
As you know, this is in QC as 32959 and was opened 01/08/2007
|
Thanks for that. I had forgotten that I ran into this several months ago
as well. :-)
| Quote: | What needs to be done to get this problem corrected in BC++?
Put some votes on it?
|
Done, but I really doubt that that will make *any* difference.
Dennis Cote |
|
| Back to top |
|
 |
Bob Gonder Guest
|
|
| Back to top |
|
 |
|