wxSQLite3 - minimald.exe - Entry Point Not Found  [SOLVED]

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
catalin
Moderator
Moderator
Posts: 1418
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

wxSQLite3 - minimald.exe - Entry Point Not Found

Postby catalin » Tue Jul 12, 2016 9:23 pm

Hello,

I've downloaded master code from github and built debug win32 with VC12 and wxW3.1 (I've modified the project file to link against the correct libs).
When running minimald.exe I get the following message and the app exits:
The procedure entry point sqlite3_compileoption_used could not be located in the dynamic link library sqlite3.dll.

Does anybody have any idea what might go wrong?

utelle
Moderator
Moderator
Posts: 795
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLite3 - minimald.exe - Entry Point Not Found  [SOLVED]

Postby utelle » Wed Jul 13, 2016 7:21 am

catalin wrote:I've downloaded master code from github and built debug win32 with VC12 and wxW3.1 (I've modified the project file to link against the correct libs).

I will try to add direct support for wxWidgets 3.1 in the future.

catalin wrote:When running minimald.exe I get the following message and the app exits:
The procedure entry point sqlite3_compileoption_used could not be located in the dynamic link library sqlite3.dll.

Does anybody have any idea what might go wrong?

I suspect that an outdated SQLite DLL was found on the search path first.

The function sqlite3_compileoption_used was introduced in SQLite3 Version 3.6.23. That is, if the entry point is missing the found DLL represents an older version of SQLite.

It is important to compile wxSQLite3 using the header file and the link library of the SQLite3 version that will be used with the application. In case of dynamically loading the SQLite DLL, wxSQLite3 could be enhanced to check the SQLite version at runtime. However, if a link library was used, this is not possible, because the operating system loads the DLL (and emits an error message in case of problems), before wxSQLite3 gets a chance to check the SQLite version number.

Although wxSQLite3 supports the use of SQLite3 DLLs, I would strongly recommend to bundle SQLite statically compiled with your application. That way your application would always use the expected version of SQLite.

Regards,

Ulrich

catalin
Moderator
Moderator
Posts: 1418
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: wxSQLite3 - minimald.exe - Entry Point Not Found

Postby catalin » Wed Jul 13, 2016 9:37 am

Thanks for the answer!
Indeed, copying one of the sqlite3\secure\aesXXX\dll\release\sqlite3.dll into samples\ did start minimald.exe (using sqlite3\lib\sqlite3.dll still failed, but with a different error).

I have nothing against statically compiled SQLite, but this is the sample that comes with wxSQLite3. Maybe the sample should also use statically compiled SQLite? Or somehow (a post-build step would create a hard link to the correct dll inside samples\) make sure the right dll is used when attempting to run it?

In case it helps, wxW has wxShortVersionString symbol defined in build\msw\wx_setup.props. Maybe that can be used for wxW library names, i.e. wxbase$(wxShortVersionString)ud.lib ? or even better, wxbase$(wxShortVersionString)$(wxSuffix).lib
I didn't try it myself though...

Regards,
C

utelle
Moderator
Moderator
Posts: 795
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLite3 - minimald.exe - Entry Point Not Found

Postby utelle » Thu Jul 14, 2016 8:33 am

catalin wrote:Indeed, copying one of the sqlite3\secure\aesXXX\dll\release\sqlite3.dll into samples\ did start minimald.exe (using sqlite3\lib\sqlite3.dll still failed, but with a different error).

What error did you get? If it is a bug in wxSQLite3 or the sample application, it should certainly be fixed.

catalin wrote:I have nothing against statically compiled SQLite, but this is the sample that comes with wxSQLite3. Maybe the sample should also use statically compiled SQLite? Or somehow (a post-build step would create a hard link to the correct dll inside samples\) make sure the right dll is used when attempting to run it?

Maybe it would be indeed the best to use a statically compiled SQLite library as the default for building wxSQLite3.

catalin wrote:In case it helps, wxW has wxShortVersionString symbol defined in build\msw\wx_setup.props. Maybe that can be used for wxW library names, i.e. wxbase$(wxShortVersionString)ud.lib ? or even better, wxbase$(wxShortVersionString)$(wxSuffix).lib
I didn't try it myself though...

I'll have to check how this is solved in wxWidgets and how I can adopt this mechansim.

Regards,

Ulrich

catalin
Moderator
Moderator
Posts: 1418
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: wxSQLite3 - minimald.exe - Entry Point Not Found

Postby catalin » Thu Jul 14, 2016 8:55 am

utelle wrote:What error did you get?

With sqlite3\lib\sqlite3.dll I got
The procedure entry point sqlite3_key could not be located in the dynamic link library sqlite3.dll.

utelle
Moderator
Moderator
Posts: 795
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSQLite3 - minimald.exe - Entry Point Not Found

Postby utelle » Thu Jul 14, 2016 10:01 am

catalin wrote:With sqlite3\lib\sqlite3.dll I got
The procedure entry point sqlite3_key could not be located in the dynamic link library sqlite3.dll.

The folder sqlite3\lib contains the SQLite DLL originally distributed with SQLite, that is, it does not support encryption. If you compiled wxSQLite3 with enryption support enabled - as you obviously did -, you have to use the pre-compiled SQLite DLL with encryption support, either sqlite3\secure\aes128\dll\release or sqlite3\secure\aes256\dll\release depending on whether you want to use AES 128 bit or 256 bit encryption.

As you said in a previous post, it would be probably best to compile wxSQLite3 with a statically linked SQLite library to avoid such confusion.

Regards,

Ulrich


Return to “Database Related”

Who is online

Users browsing this forum: No registered users and 1 guest