Re: [sqlite] sqlite3 close() run time errors
Michele Santucci wrote: Following your hint I create a simple project (linked sqlite3.lib and included sqlite3.h) where I just do this: Edit2->Text = AnsiString( sqlite3_libversion() ); I got this at compile time: [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::aConstraint' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::nOrderBy' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::aOrderBy' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::aConstraintUsage' in class without constructors Pretty strange Michele, This is also a bug in the Borland/CodeGear C++ compiler (see http://qc.borland.com/wc/qcmain.aspx?d=32959 ). I am trying to get this report reopened, but in the meantime you will probably have to change the sqlite3.h file to add a conditional around the sqlite3_index_info definition, and remove the offending const qualifiers like this: #ifdef __BORLANDC__ struct sqlite3_index_info { /* Inputs */ 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 */ } *aConstraint; /* Table of WHERE clause constraints */ 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. */ } *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 */ } *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 */ }; #else 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 */ }; #endif Be advised, that after I do this I get a similar unresolved external error for _sqlite3_libversion. I'm trying to see what might be causing this, but the generated sqlite3.lib file looks OK on first inspection. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
Maybe it is but it's hard to find the way to generate a suitable sqlite3.lib then. - Original Message - From: "Roberto" <[EMAIL PROTECTED]> To: Sent: Tuesday, December 12, 2006 1:49 PM Subject: Re: [sqlite] sqlite3 close() run time errors On 12/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote: this's a run-time error not a linker error. It's a runtime error cos it is linked incorrectly! Specify the sqlite.def file (which IIRC lists the undecorated aliases of the sqlite functions) as an option to the command line of implib. - To unsubscribe, send email to [EMAIL PROTECTED] - -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.15.16/582 - Release Date: 11/12/2006 16.32 - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
Following your hint I create a simple project (linked sqlite3.lib and included sqlite3.h) where I just do this: Edit2->Text = AnsiString( sqlite3_libversion() ); I got this at compile time: [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::nConstraint' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::aConstraint' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::nOrderBy' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::aOrderBy' in class without constructors [C++ Error] sqlite3.h(1719): E2232 Constant member 'sqlite3_index_info::aConstraintUsage' in class without constructors Pretty strange - Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: Sent: Tuesday, December 12, 2006 8:48 PM Subject: Re: [sqlite] sqlite3 close() run time errors Michele Santucci wrote: I used borland IMPLIB import tool with -a attribute (this add the leading underscore for cdecl compliance). If I didn't use this flag I got linking error about missing references... this's a run-time error not a linker error. Michele, This is a problem I discovered with Borland IMPLIB. The fix I found is described under ticket 1291 at http://www.sqlite.org/cvstrac/tktview?tn=1291 For some reason implib doesn't generate the correct symbols when converting directly from the dll file. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] - -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.15.18/585 - Release Date: 13/12/2006 11.49 - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
Michele Santucci wrote: I used borland IMPLIB import tool with -a attribute (this add the leading underscore for cdecl compliance). If I didn't use this flag I got linking error about missing references... this's a run-time error not a linker error. Michele, This is a problem I discovered with Borland IMPLIB. The fix I found is described under ticket 1291 at http://www.sqlite.org/cvstrac/tktview?tn=1291 For some reason implib doesn't generate the correct symbols when converting directly from the dll file. HTH Dennis Cote - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
On 12/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote: this's a run-time error not a linker error. It's a runtime error cos it is linked incorrectly! Specify the sqlite.def file (which IIRC lists the undecorated aliases of the sqlite functions) as an option to the command line of implib. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
On 12/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote: this's a run-time error not a linker error. It sounds like a load time error. If that's the case, and it is the Windows loader, then your import tool did not do translation correctly: it's looking for the literal name "_sqlite3_open" in the DLL exports. Such a name does not exist. The Microsoft import library format sets up name translations, where the underscore is supplied for the usual linking mechanisms, but the linker is also instructed to place the undecorated name in the dependency table. You want to have your tool do the same thing. Failing that, look for a way to have the compiler not apply decorations to dllimport function declarations. One of those must be supported, since it would be required to use Windows API functions (stdcall has a decoration format of its own). Failing that, give up on the stock dll and build your own, or compile sqlite directly into your project :) - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
See the answer to 'Roberto' in the same thread I create the .lib trough Borland IMPLIB with the proper flag to add leading _underscores. - Original Message - From: "Marten Feldtmann" <[EMAIL PROTECTED]> To: Sent: Monday, December 11, 2006 3:55 PM Subject: Re: [sqlite] sqlite3 close() run time errors Michele Santucci schrieb: Hello, I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev tool). I took the last sqlite3 dll and source. I create the .lib file linked it to the binary and included the sqlite3.h file... but as long as I start the application I got an error about a missing entry point of the _sqlite3_close() function... why? Calling convention and name decoration. Your linker knows, that sqlite3_close() has to be called via cdecl calling convention and does not look for sqlite_close(), but for _sqlite_close(). You have to tell your IDE, Linker - that it should not use naming decoration. Marten - To unsubscribe, send email to [EMAIL PROTECTED] - -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.15.15/581 - Release Date: 09/12/2006 15.41 - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
I used borland IMPLIB import tool with -a attribute (this add the leading underscore for cdecl compliance). If I didn't use this flag I got linking error about missing references... this's a run-time error not a linker error. - Original Message - From: "Roberto" <[EMAIL PROTECTED]> To: Sent: Monday, December 11, 2006 3:59 PM Subject: Re: [sqlite] sqlite3 close() run time errors You are probably linking against exports with a leading underscore. (The exports of sqlite3.dll don't have the _underscore). Does your dev environment/linker have the option to disable this underscore generation? On 11/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote: Hello, I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev tool). I took the last sqlite3 dll and source. I create the .lib file linked it to the binary and included the sqlite3.h file... but as long as I start the application I got an error about a missing entry point of the _sqlite3_close() function... why? May depends on mscvrt dependancies? Distinti saluti, Michele Santucci = Software Development Manager * Celin Avio s.r.l. * tel. +39-0187933876 fax +39-0187933654 web: http://www.celinavio.it = - To unsubscribe, send email to [EMAIL PROTECTED] - -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.15.15/581 - Release Date: 09/12/2006 15.41 - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
You are probably linking against exports with a leading underscore. (The exports of sqlite3.dll don't have the _underscore). Does your dev environment/linker have the option to disable this underscore generation? On 11/12/06, Michele Santucci <[EMAIL PROTECTED]> wrote: Hello, I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev tool). I took the last sqlite3 dll and source. I create the .lib file linked it to the binary and included the sqlite3.h file... but as long as I start the application I got an error about a missing entry point of the _sqlite3_close() function... why? May depends on mscvrt dependancies? Distinti saluti, Michele Santucci = Software Development Manager * Celin Avio s.r.l. * tel. +39-0187933876 fax +39-0187933654 web: http://www.celinavio.it = - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite3 close() run time errors
Michele Santucci schrieb: Hello, I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev tool). I took the last sqlite3 dll and source. I create the .lib file linked it to the binary and included the sqlite3.h file... but as long as I start the application I got an error about a missing entry point of the _sqlite3_close() function... why? Calling convention and name decoration. Your linker knows, that sqlite3_close() has to be called via cdecl calling convention and does not look for sqlite_close(), but for _sqlite_close(). You have to tell your IDE, Linker - that it should not use naming decoration. Marten - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] sqlite3 close() run time errors
Hello, I'm trying to use sqlite3 into a CVI (National Itruments ANSI C dev tool). I took the last sqlite3 dll and source. I create the .lib file linked it to the binary and included the sqlite3.h file... but as long as I start the application I got an error about a missing entry point of the _sqlite3_close() function... why? May depends on mscvrt dependancies? Distinti saluti, Michele Santucci = Software Development Manager * Celin Avio s.r.l. * tel. +39-0187933876 fax +39-0187933654 web: http://www.celinavio.it =