RE: [sqlite] sqlite and borland c++ builder
Thanks for the response, people have generously sent me file that work and I'm up and running! Thanks - Jon -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 10:31 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder Jonathan Kahn wrote: > > > When I try to use the header I get errors > > [C++ Error] sqlite3.h(1778): E2232 Constant member > 'sqlite3_index_info::nConstraint' in class without constructors > > > > Jonathan, This is indeed a bug in the Borland/CodeGear compiler. It has been discussed on their mailing lists several times and is currently in their bug tracking system http://qc.codegear.com/wc/qcmain.aspx?d=32959. I just posted a message when I ran into the same problem trying to use a current version of sqlite see http://groups.google.ca/group/borland.public.cppbuilder.language.cpp/browse_ frm/thread/f04139e048a2f55/98b6a1c5616057b4?lnk=st=sqlite+E2232+=1#98 b6a1c5616057b4 I forgot that I had ran into this problem earlier. It hasn't been a huge issue for me since most of my sqlite use is done with an older version of sqlite (3.2.7) that doesn't trigger this problem. You can work around the problem by creating a modified sqlite3.h header that eliminates the const qualifiers from the offending declarations. You could also comment out the entire structure definition and change the type of the second argument to xBestIndex to a void pointer if you are not going to use the virtual table interfaces. or you could use an older version from before June of 2006 when these items were added to the header file. I have had no problems building either a dll or a static library using the Borland compiler in C mode. The problems occur when you try to include the standard sqlite3.h header into a C++ source file. It might help to post to the newsgroups saying you are also having problems, or to vote on the bug in the QC system. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite and borland c++ builder
Jonathan Kahn wrote: When I try to use the header I get errors [C++ Error] sqlite3.h(1778): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors Jonathan, This is indeed a bug in the Borland/CodeGear compiler. It has been discussed on their mailing lists several times and is currently in their bug tracking system http://qc.codegear.com/wc/qcmain.aspx?d=32959. I just posted a message when I ran into the same problem trying to use a current version of sqlite see http://groups.google.ca/group/borland.public.cppbuilder.language.cpp/browse_frm/thread/f04139e048a2f55/98b6a1c5616057b4?lnk=st=sqlite+E2232+=1#98b6a1c5616057b4 I forgot that I had ran into this problem earlier. It hasn't been a huge issue for me since most of my sqlite use is done with an older version of sqlite (3.2.7) that doesn't trigger this problem. You can work around the problem by creating a modified sqlite3.h header that eliminates the const qualifiers from the offending declarations. You could also comment out the entire structure definition and change the type of the second argument to xBestIndex to a void pointer if you are not going to use the virtual table interfaces. or you could use an older version from before June of 2006 when these items were added to the header file. I have had no problems building either a dll or a static library using the Borland compiler in C mode. The problems occur when you try to include the standard sqlite3.h header into a C++ source file. It might help to post to the newsgroups saying you are also having problems, or to vote on the bug in the QC system. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
Hi John, Thank's for responding. Someone actually very generously emailed me an attachment a bit earlier that seemed to work, now I am having other problems which I think are unrelated. To be honest I am beginning to think it is this version of c++ builder that is just extremely buggy. Thanks, - Jon -Original Message- From: John Stanton [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 12:31 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder Why not use gcc to compile your library, or use a precompiled DLL? Jonathan Kahn wrote: > Hi Ulrik, > Thank you for responding. I'll try anything! The frustration that all > this has brought me I am determined to solve it. > > If I built SQLite with a C compiler what would be the result? What would > I be able to work with from within c++? Won't compiling leave me with an > executable? I am fairly new to dealing with different compilers and things, > so please forgive my ignorance. > > Thanks a lot, > - Jon > > > -Original Message- > From: Ulrik Petersen [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 29, 2007 2:29 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] sqlite and borland c++ builder > > Hi Jon, > > is it not an option to build SQLite with a C compiler, then call it from > within C++? > > > Regards, > > Ulrik Petersen > > > Jonathan Kahn wrote: > >>Even when I try to build a new dll I get errors with attach.c and it says >>cannot convert 'void *' to 'Db *', no matter what route I take I always > > hit > >>a bump. I'm just trying anything at this point >> >>- Jon >> >>-Original Message- >>From: Joe Wilson [mailto:[EMAIL PROTECTED] >>Sent: Sunday, April 29, 2007 1:59 AM >>To: sqlite-users@sqlite.org >>Subject: Re: [sqlite] sqlite and borland c++ builder >> >>I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". >> >>But the almalgomated sqlite3.c cannot be compiled from a C++ compiler >>for the reasons described below. >> >>--- Joe Wilson <[EMAIL PROTECTED]> wrote: >> >> >>>> When I try to use the header I get errors >>>> >>>> [C++ Error] sqlite3.h(1778): E2232 Constant member >>>>'sqlite3_index_info::nConstraint' in class without constructors >>>> >>> >>>It appears it is trying to compile the sqlite header file as if it were >>> >> >>C++. >> >> >>>Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? >>> >>>from the generated sqlite3.c: >>> >>> /* >>> ** Make sure we can call this stuff from C++. >>> */ >>> #if 0 >>> extern "C" { >>> #endif >>> >>>See the #if 0? That's the problem. It should be: >>> >>> #if __cplusplus >>> >>>SQLite 3.3.17 has a bug in sqlite3.c generation. >>>To work around this issue, do this: >>> >>> extern "C" { >>> #include "sqlite3.h" >>> } >>> >>> >>>__ >>>Do You Yahoo!? >>>Tired of spam? Yahoo! Mail has the best spam protection around >>>http://mail.yahoo.com >>> >>> >>> >> > > >>- >> >> >>>To unsubscribe, send email to [EMAIL PROTECTED] >>> >>> >> > > >>- >> >> >>> >> >> >>__ >>Do You Yahoo!? >>Tired of spam? Yahoo! Mail has the best spam protection around >>http://mail.yahoo.com >> >> > > > >>- >>To unsubscribe, send email to [EMAIL PROTECTED] >> > > > >>- >> >> >> > > > - > >>To unsubscribe, send email to [EMAIL PROTECTED] >> > > > - > >> >> > > > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > > - > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite and borland c++ builder
Why not use gcc to compile your library, or use a precompiled DLL? Jonathan Kahn wrote: Hi Ulrik, Thank you for responding. I'll try anything! The frustration that all this has brought me I am determined to solve it. If I built SQLite with a C compiler what would be the result? What would I be able to work with from within c++? Won't compiling leave me with an executable? I am fairly new to dealing with different compilers and things, so please forgive my ignorance. Thanks a lot, - Jon -Original Message- From: Ulrik Petersen [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 2:29 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder Hi Jon, is it not an option to build SQLite with a C compiler, then call it from within C++? Regards, Ulrik Petersen Jonathan Kahn wrote: Even when I try to build a new dll I get errors with attach.c and it says cannot convert 'void *' to 'Db *', no matter what route I take I always hit a bump. I'm just trying anything at this point - Jon -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 1:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". But the almalgomated sqlite3.c cannot be compiled from a C++ compiler for the reasons described below. --- Joe Wilson <[EMAIL PROTECTED]> wrote: When I try to use the header I get errors [C++ Error] sqlite3.h(1778): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors It appears it is trying to compile the sqlite header file as if it were C++. Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? from the generated sqlite3.c: /* ** Make sure we can call this stuff from C++. */ #if 0 extern "C" { #endif See the #if 0? That's the problem. It should be: #if __cplusplus SQLite 3.3.17 has a bug in sqlite3.c generation. To work around this issue, do this: extern "C" { #include "sqlite3.h" } __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
Hi Ulrik, Sqlite3.h already seems to have the #ifdef extern "C" , etc as Joe Wilson mentioned, and I try just #include and I get that error I mentioned in my previous post about "[C++ Error] sqlite3.h(1778): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors" I searched on google about this and someone removed the const's from the structs related to sqlite3_index_info and then it compiles with the header but then I hit yet another error which states: "Unresolved external '_sqlite3_open' referenced from MAIN.OBJ" I think others have posted receiving that error but I'm not sure there were any resolutions..Any ideas on this note? Thanks - Jon -Original Message- From: Ulrik Petersen [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 2:53 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder Hi Jonathan, I don't use Borland C, so I can' help you with the specifics of that compiler. But no, you don't necessarily get an executable just by compiling with a C compiler. You should be able to compile SQLite with a C compiler, and in the process obtain one or more .o files. (Perhaps they are called .obj in Borland C.) With the GNU C compiler (and many other compilers), the switch to create a .o file instead of an executable is -c. Maybe this translates to /c on Borland C, but you'd have to consult your Borland C manual for that. These .o/.obj files can be linked into your C++ program. If you follow Joe Wilson's advice and just #include from within C++, it should work. That is exactly what the 'extern "C"' clause is for in C++: It tells the C++ compiler that the functions within the 'extern "C" { ... }' block were compiled with a compiler that emits code with C calling conventions. This enables calling C code from within C++. As you probably know, calling conventions have to do with, among other things, the way function parameters are put on the stack, and the way any return value is returned. HTH Regards, Ulrik Petersen Jonathan Kahn wrote: > Hi Ulrik, > Thank you for responding. I'll try anything! The frustration that all > this has brought me I am determined to solve it. > > If I built SQLite with a C compiler what would be the result? What would > I be able to work with from within c++? Won't compiling leave me with an > executable? I am fairly new to dealing with different compilers and things, > so please forgive my ignorance. > > Thanks a lot, > - Jon > > > -Original Message- > From: Ulrik Petersen [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 29, 2007 2:29 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] sqlite and borland c++ builder > > Hi Jon, > > is it not an option to build SQLite with a C compiler, then call it from > within C++? > > > Regards, > > Ulrik Petersen > > > Jonathan Kahn wrote: > >> Even when I try to build a new dll I get errors with attach.c and it says >> cannot convert 'void *' to 'Db *', no matter what route I take I always >> > hit > >> a bump. I'm just trying anything at this point >> >> - Jon >> >> -Original Message- >> From: Joe Wilson [mailto:[EMAIL PROTECTED] >> Sent: Sunday, April 29, 2007 1:59 AM >> To: sqlite-users@sqlite.org >> Subject: Re: [sqlite] sqlite and borland c++ builder >> >> I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". >> >> But the almalgomated sqlite3.c cannot be compiled from a C++ compiler >> for the reasons described below. >> >> --- Joe Wilson <[EMAIL PROTECTED]> wrote: >> >> >>>> When I try to use the header I get errors >>>> >>>> [C++ Error] sqlite3.h(1778): E2232 Constant member >>>> 'sqlite3_index_info::nConstraint' in class without constructors >>>> >>>> >>> It appears it is trying to compile the sqlite header file as if it were >>> >>> >> C++. >> >> >>> Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? >>> >>> from the generated sqlite3.c: >>> >>> /* >>> ** Make sure we can call this stuff from C++. >>> */ >>> #if 0 >>> extern "C" { >>> #endif >>> >>> See the #if 0? That's the problem. It should be: >>> >>> #if __cplusplus >>> >>> SQLite 3.3.17 has a bug in sqlite3.c generation. >>> To work around this issue, do this: >>> >>> extern "C" { >>> #include "sqlite3.h"
Re: [sqlite] sqlite and borland c++ builder
Hi Jonathan, I don't use Borland C, so I can' help you with the specifics of that compiler. But no, you don't necessarily get an executable just by compiling with a C compiler. You should be able to compile SQLite with a C compiler, and in the process obtain one or more .o files. (Perhaps they are called .obj in Borland C.) With the GNU C compiler (and many other compilers), the switch to create a .o file instead of an executable is -c. Maybe this translates to /c on Borland C, but you'd have to consult your Borland C manual for that. These .o/.obj files can be linked into your C++ program. If you follow Joe Wilson's advice and just #include from within C++, it should work. That is exactly what the 'extern "C"' clause is for in C++: It tells the C++ compiler that the functions within the 'extern "C" { ... }' block were compiled with a compiler that emits code with C calling conventions. This enables calling C code from within C++. As you probably know, calling conventions have to do with, among other things, the way function parameters are put on the stack, and the way any return value is returned. HTH Regards, Ulrik Petersen Jonathan Kahn wrote: Hi Ulrik, Thank you for responding. I'll try anything! The frustration that all this has brought me I am determined to solve it. If I built SQLite with a C compiler what would be the result? What would I be able to work with from within c++? Won't compiling leave me with an executable? I am fairly new to dealing with different compilers and things, so please forgive my ignorance. Thanks a lot, - Jon -Original Message- From: Ulrik Petersen [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 2:29 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder Hi Jon, is it not an option to build SQLite with a C compiler, then call it from within C++? Regards, Ulrik Petersen Jonathan Kahn wrote: Even when I try to build a new dll I get errors with attach.c and it says cannot convert 'void *' to 'Db *', no matter what route I take I always hit a bump. I'm just trying anything at this point - Jon -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 1:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". But the almalgomated sqlite3.c cannot be compiled from a C++ compiler for the reasons described below. --- Joe Wilson <[EMAIL PROTECTED]> wrote: When I try to use the header I get errors [C++ Error] sqlite3.h(1778): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors It appears it is trying to compile the sqlite header file as if it were C++. Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? from the generated sqlite3.c: /* ** Make sure we can call this stuff from C++. */ #if 0 extern "C" { #endif See the #if 0? That's the problem. It should be: #if __cplusplus SQLite 3.3.17 has a bug in sqlite3.c generation. To work around this issue, do this: extern "C" { #include "sqlite3.h" } __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
Also, I tried changing to #ifdef __cplusplus and I still encounter many errors such as "Constant member 'sqlite3_index_info::nConstraint' in class without constructors" which is the same error as in sqlite3.h Thanks - Jon -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 2:12 AM To: sqlite-users@sqlite.org Subject: RE: [sqlite] sqlite and borland c++ builder --- Jonathan Kahn <[EMAIL PROTECTED]> wrote: > I really appreciate your response. What do you suggest I do? Is there > something else I need to include aside from sqlite3.lib? I am willing to > try anything. I only use GNU C++, so I can't help you with .lib files. I'd suggest to compile sqlite3.c with a C compiler or change sqlite3.c to include this: #ifdef __cplusplus extern "C" { #endif ... contents of sqlite3.c ... #ifdef __cplusplus } #endif sqlite3.h has the correct __cplusplus extern wrapper. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
Hi Ulrik, Thank you for responding. I'll try anything! The frustration that all this has brought me I am determined to solve it. If I built SQLite with a C compiler what would be the result? What would I be able to work with from within c++? Won't compiling leave me with an executable? I am fairly new to dealing with different compilers and things, so please forgive my ignorance. Thanks a lot, - Jon -Original Message- From: Ulrik Petersen [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 2:29 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder Hi Jon, is it not an option to build SQLite with a C compiler, then call it from within C++? Regards, Ulrik Petersen Jonathan Kahn wrote: > Even when I try to build a new dll I get errors with attach.c and it says > cannot convert 'void *' to 'Db *', no matter what route I take I always hit > a bump. I'm just trying anything at this point > > - Jon > > -Original Message- > From: Joe Wilson [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 29, 2007 1:59 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] sqlite and borland c++ builder > > I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". > > But the almalgomated sqlite3.c cannot be compiled from a C++ compiler > for the reasons described below. > > --- Joe Wilson <[EMAIL PROTECTED]> wrote: > >>> When I try to use the header I get errors >>> >>> [C++ Error] sqlite3.h(1778): E2232 Constant member >>> 'sqlite3_index_info::nConstraint' in class without constructors >>> >> It appears it is trying to compile the sqlite header file as if it were >> > C++. > >> Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? >> >> from the generated sqlite3.c: >> >> /* >> ** Make sure we can call this stuff from C++. >> */ >> #if 0 >> extern "C" { >> #endif >> >> See the #if 0? That's the problem. It should be: >> >> #if __cplusplus >> >> SQLite 3.3.17 has a bug in sqlite3.c generation. >> To work around this issue, do this: >> >> extern "C" { >> #include "sqlite3.h" >> } >> >> >> __ >> Do You Yahoo!? >> Tired of spam? Yahoo! Mail has the best spam protection around >> http://mail.yahoo.com >> >> >> > > - > >> To unsubscribe, send email to [EMAIL PROTECTED] >> >> > > - > >> > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > > - > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > > - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite and borland c++ builder
Hi Jon, is it not an option to build SQLite with a C compiler, then call it from within C++? Regards, Ulrik Petersen Jonathan Kahn wrote: Even when I try to build a new dll I get errors with attach.c and it says cannot convert 'void *' to 'Db *', no matter what route I take I always hit a bump. I'm just trying anything at this point - Jon -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 1:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". But the almalgomated sqlite3.c cannot be compiled from a C++ compiler for the reasons described below. --- Joe Wilson <[EMAIL PROTECTED]> wrote: When I try to use the header I get errors [C++ Error] sqlite3.h(1778): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors It appears it is trying to compile the sqlite header file as if it were C++. Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? from the generated sqlite3.c: /* ** Make sure we can call this stuff from C++. */ #if 0 extern "C" { #endif See the #if 0? That's the problem. It should be: #if __cplusplus SQLite 3.3.17 has a bug in sqlite3.c generation. To work around this issue, do this: extern "C" { #include "sqlite3.h" } __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
--- Jonathan Kahn <[EMAIL PROTECTED]> wrote: > I really appreciate your response. What do you suggest I do? Is there > something else I need to include aside from sqlite3.lib? I am willing to > try anything. I only use GNU C++, so I can't help you with .lib files. I'd suggest to compile sqlite3.c with a C compiler or change sqlite3.c to include this: #ifdef __cplusplus extern "C" { #endif ... contents of sqlite3.c ... #ifdef __cplusplus } #endif sqlite3.h has the correct __cplusplus extern wrapper. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
Even when I try to build a new dll I get errors with attach.c and it says cannot convert 'void *' to 'Db *', no matter what route I take I always hit a bump. I'm just trying anything at this point - Jon -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 1:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". But the almalgomated sqlite3.c cannot be compiled from a C++ compiler for the reasons described below. --- Joe Wilson <[EMAIL PROTECTED]> wrote: > > When I try to use the header I get errors > > > > [C++ Error] sqlite3.h(1778): E2232 Constant member > > 'sqlite3_index_info::nConstraint' in class without constructors > > It appears it is trying to compile the sqlite header file as if it were C++. > Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? > > from the generated sqlite3.c: > > /* > ** Make sure we can call this stuff from C++. > */ > #if 0 > extern "C" { > #endif > > See the #if 0? That's the problem. It should be: > > #if __cplusplus > > SQLite 3.3.17 has a bug in sqlite3.c generation. > To work around this issue, do this: > > extern "C" { > #include "sqlite3.h" > } > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] sqlite and borland c++ builder
I really appreciate your response. What do you suggest I do? Is there something else I need to include aside from sqlite3.lib? I am willing to try anything. Thanks a lot - Jon -Original Message- From: Joe Wilson [mailto:[EMAIL PROTECTED] Sent: Sunday, April 29, 2007 1:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] sqlite and borland c++ builder I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". But the almalgomated sqlite3.c cannot be compiled from a C++ compiler for the reasons described below. --- Joe Wilson <[EMAIL PROTECTED]> wrote: > > When I try to use the header I get errors > > > > [C++ Error] sqlite3.h(1778): E2232 Constant member > > 'sqlite3_index_info::nConstraint' in class without constructors > > It appears it is trying to compile the sqlite header file as if it were C++. > Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? > > from the generated sqlite3.c: > > /* > ** Make sure we can call this stuff from C++. > */ > #if 0 > extern "C" { > #endif > > See the #if 0? That's the problem. It should be: > > #if __cplusplus > > SQLite 3.3.17 has a bug in sqlite3.c generation. > To work around this issue, do this: > > extern "C" { > #include "sqlite3.h" > } > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite and borland c++ builder
I wrote too quickly - sqlite3.h correctly uses __cplusplus for extern "C". But the almalgomated sqlite3.c cannot be compiled from a C++ compiler for the reasons described below. --- Joe Wilson <[EMAIL PROTECTED]> wrote: > > When I try to use the header I get errors > > > > [C++ Error] sqlite3.h(1778): E2232 Constant member > > 'sqlite3_index_info::nConstraint' in class without constructors > > It appears it is trying to compile the sqlite header file as if it were C++. > Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? > > from the generated sqlite3.c: > > /* > ** Make sure we can call this stuff from C++. > */ > #if 0 > extern "C" { > #endif > > See the #if 0? That's the problem. It should be: > > #if __cplusplus > > SQLite 3.3.17 has a bug in sqlite3.c generation. > To work around this issue, do this: > > extern "C" { > #include "sqlite3.h" > } > > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite and borland c++ builder
> When I try to use the header I get errors > > [C++ Error] sqlite3.h(1778): E2232 Constant member > 'sqlite3_index_info::nConstraint' in class without constructors It appears it is trying to compile the sqlite header file as if it were C++. Lemme guess - you're using the almalgomated sqlite3.c from 3.3.17, right? from the generated sqlite3.c: /* ** Make sure we can call this stuff from C++. */ #if 0 extern "C" { #endif See the #if 0? That's the problem. It should be: #if __cplusplus SQLite 3.3.17 has a bug in sqlite3.c generation. To work around this issue, do this: extern "C" { #include "sqlite3.h" } __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite with borland c builder
Make sure you compile the dll (if you are compiling a dll, offcourse) with the C calling convention. I'm not sure now, but if I remember correctly that is not the default for the Borland compiler. Other cause could be not linking with the import library, but that is basic. Just my two cents. I don't work with a borland compiler anymore. Regards, ~Nuno Lucas === On 2004-04-02, Roy Black wrote === >Hello, > >I would like to develop some applications with sqlite. I am using Borland C >builder 6 for these purposes. I was trying to compile/install sqlite for >Borland C builder 6 (Windows) without success. I followed the instructions >at http://www.sqlite.org/cvstrac/wiki?p=HowToCompile but got the same. >I think I missed some thing important but don't know what. Each time I build >a sample code I get such an error: >Linker Error: Unresolved external reference _sqlite_open > >If you know how to deal with this issue please let me know, the more details >the better (I'm a newbie) > >Thank you for your attention. > >Roy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [sqlite] sqlite with borland c builder
Make sure you compile the dll (if you are compiling a dll, offcourse) with the C calling convention. I'm not sure now, but if I remember correctly that is not the default for the Borland compiler. Other cause could be not linking with the import library, but that is basic. Just my two cents. I don't work with a borland compiler anymore. Regards, ~Nuno Lucas === On 2004-04-02, Roy Black wrote === >Hello, > >I would like to develop some applications with sqlite. I am using Borland C >builder 6 for these purposes. I was trying to compile/install sqlite for >Borland C builder 6 (Windows) without success. I followed the instructions >at http://www.sqlite.org/cvstrac/wiki?p=HowToCompile but got the same. >I think I missed some thing important but don't know what. Each time I build >a sample code I get such an error: >Linker Error: Unresolved external reference _sqlite_open > >If you know how to deal with this issue please let me know, the more details >the better (I'm a newbie) > >Thank you for your attention. > >Roy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]