[Solved] Can not load SQLite client library "SQLite3.dll". Check your install... lazarus / 16-Databases ---------------------------------------------------------------------- kpeters58 · 2012-12-16 02:28 Hi, 1.04 32 bit on Win7 64 bit: Today all of my SQLite bases projects stopped working with above error. Am not aware of having made any changes besides some installs/uninstalls (which I realize may somehow have impacted said DLL). Which version of that DLL needs to be present where? I have 6 different copies of it all over my harddrive. I did copy every single one of them into the project dir of one of my SQLite projects and tried to set the SQLite3Connection to active - all of them failed. Do both run- & design time look for the same DLL locations? I have an sqlite3.inc in my Lazarus tree which seems to look for 3.5.9 - most of the DLLs on my system unfortunately have no version information (only one by Apple does).... Any pointers? TIA, Kai ---------------------------------------------------------------------- Leledumbo · 2012-12-16 05:57 QuoteDo both run- & design time look for the same DLL locations?No, the design time uses what lazarus loads, the run time uses what you app loads. Both can be the same though. Since SQLite is portable, you can put it along with your application (it's windows only, right?) and it would be preferred over system wide one. The common problem is a mix of 32-bit and 64-bit app and library (any combination of them). 32-bit app should use 32-bit dll, and so is for 64-bit. ---------------------------------------------------------------------- kpeters58 · 2012-12-16 20:43 Hm - certainly not the case here: Fresh install of 1.04 32 bit and latest precompiled 32 bit SQLite3.dll from sqlite.org inf the project directory. Can't seem to debug into the underlying sources (even though I rebuilt Lazarus with debug) - must be missing something. Tried a text search for the error message across my entire lazarus directory but it only shows  up in lazarus.exe - nowhere in the source... Am really confused now.. ---------------------------------------------------------------------- kpeters58 · 2012-12-18 03:04 Analyzed a working setup on a different machine with procexplorer and found that Lazarus 32bit wants to load sqlite3.dll from \Windows\SysWow64\. Why it wouldn't fall back on looking for it in the current project folder is a mystery to me....???? Seems that one of my uninstalls must have removed that DLL from there. Downloaded the latest one from sqlite.org, put it there and all appears to be well. ---------------------------------------------------------------------- Leledumbo · 2012-12-18 11:40 QuoteAnalyzed a working setup on a different machine with procexplorer and found that Lazarus 32bit wants to load sqlite3.dll from \Windows\SysWow64\Now I'm confused, is it your application or Lazarus that's having this loading problem? ---------------------------------------------------------------------- BigChimp · 2012-12-18 11:43 Probably Lazarus. He probably doesn't have the sqlite dll in his project source dir (AFAIR, putting it in the lazarus dir works too) - he probably only has the dll in the project output dir... ---------------------------------------------------------------------- kpeters58 · 2012-12-18 17:02 I am talking about Lazarus - and I do have a good 32bit DLL in the project source dir (right next to the project's lpi file). It seems that when using 32bit Lazarus on a 64 bit Windows system, one MUST have a 32 bit sqlite3.dll in \windows\syswow64. Without it, all attempts to open a connection at designtime fail (at least on my 2 Windows 7 boxes). At run time, my application uses the DLL in its source directory as expected (verified with procexplorer) K ---------------------------------------------------------------------- BigChimp · 2012-12-18 17:14 Sorry, I think these 2 statements contradict each other: - sqlite3.dll together with project.lpr: Quote from: kpeters58 on December 18, 2012, 06:02:36 pmI am talking about Lazarus - and I do have a good 32bit DLL in the project source dir (right next to the project's lpi file). -sqlite3.dll together with project.exe Quote from: kpeters58 on December 18, 2012, 06:02:36 pmAt run time, my application uses the DLL in its source directory as expected (verified with procexplorer) *) ... unless: project.exe and project.lpr are in the same directory? Could you confirm that (e.g. copy/paste a dir /s)? *) the application should not use the dll in the *source* directory but the *executable*/*application*/*target* directory (however you want to call it). As said, the source & application dirs can be the same... ---------------------------------------------------------------------- kpeters58 · 2012-12-18 17:46 Yes, they are the same in this case. ---------------------------------------------------------------------- BigChimp · 2012-12-18 18:29 Ok. Thanks. Hope somebody else can reproduce this.... and if so, it's either a bug or the docs need to be updated. ---------------------------------------------------------------------- Leledumbo · 2012-12-19 07:16 QuoteI am talking about Lazarus - and I do have a good 32bit DLL in the project source dir (right next to the project's lpi file).You should have the DLL in Lazarus directory. ---------------------------------------------------------------------- BigChimp · 2012-12-21 09:15 @Leledumbo, you're right. @Kpeters58, sorry I steered you in the wrong direction - seems I picked up the wrong ideas. Thinking about it, it makes sense that the IDE searches its own dir for the dlls as that is the way Windows works....  AFAIR, there were some wiki pages that have the wrong instructions - I'll update them... ---------------------------------------------------------------------- kpeters58 · 2012-12-21 20:50 Makes perfect sense and works - thanks! ---------------------------------------------------------------------- anyeos · 2012-12-26 17:07 I know it is solved but just to put some more evidence I'm in Linux and have a similar problem: Lazarus at designtime searches for a specific version of mysql, sqlite and that kind of libraries. And of course I don't have just the exact version of what Lazarus expect. My system is Ubuntu 12.04 32 bits. I'm actually using Zeos so I can specify the Library location at designtime. So that is not a problem for me. But it happens with the lazarus SQLdb components. I think the correct way is not to search for a specific version (major and minor numbers included) but at least only for a major version (or libsqlite.so for example). But actually it searches for some like libsqlite3.so.0.8.6 Lazarus 1.0.2 32 bits ---------------------------------------------------------------------- BigChimp · 2012-12-27 08:03 Quote from: anyeos on December 26, 2012, 06:07:54 pmLazarus at designtime searches for a specific version of mysql, sqlite and that kind of libraries. And of course I don't have just the exact version of what Lazarus expect. Yes, so does ZeosDB search for a certain version The problem is with the mysql libraries that expect a quite detailed specific version (e.g. 5.1 not just 5.x) as documented ad nauseam. Quote from: anyeos on December 26, 2012, 06:07:54 pmI'm actually using Zeos so I can specify the Library location at designtime. So that is not a problem for me. But it happens with the lazarus SQLdb components. You can specify the library name at designtime with sqldb, too. Specifying the library location with Zeos seems... interesting! Would you have some documentation link for that? ---------------------------------------------------------------------- fravemel · 2018-01-25 21:29 I got this same error when using last version of sqlite 3.22. The error disapeared when i downloaded previous version 3.21 from this link http://www.sqlite.org/2017/sqlite-dll-win64-x64-3210000.zip. Althoug in the page of sqlite you just have last version link, you can download previous versions checking the chonology page https://www.sqlite.org/chronology.html and typing the link with the same format of the link of the last version. https://stackoverflow.com/questions/615213/where-can-one-find-source- archives-of-old-sqlite-versions