BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

compiler error prevents using current sqlite versions

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Dennis Cote
Guest





PostPosted: Fri Apr 27, 2007 9:15 pm    Post subject: compiler error prevents using current sqlite versions Reply with quote



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





PostPosted: Sat Apr 28, 2007 7:30 pm    Post subject: Re: compiler error prevents using current sqlite versions Reply with quote



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





PostPosted: Mon Apr 30, 2007 7:41 pm    Post subject: Re: compiler error prevents using current sqlite versions Reply with quote



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





PostPosted: Mon Apr 30, 2007 9:14 pm    Post subject: Re: compiler error prevents using current sqlite versions Reply with quote

Dennis Cote wrote:

Quote:
Do you have a link?

This should do it.
http://groups.google.com/group/borland.public.cppbuilder.language.cpp/browse_thread/thread/7d4b9b2f678ed09d/d103fbc521accd9a
http://tinyurl.com/2rxhdh

Also
http://groups.google.com/group/borland.public.cppbuilder.language.cpp/browse_thread/thread/74542c5d455c7b7d/f9a4057fa36a4e2c
http://tinyurl.com/37ytt7
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.