Installing ZEOS DBO lazarus / 16-Databases ---------------------------------------------------------------------- Caravelle · 2014-06-10 17:35 In another thread I was recommended to try the ZEOS components for using sqlite. For the second  time I have wasted a considerable amount of time trying to install ZEOS and failing. There are contradictory instructions wherever I look and none of them work.  Rather than rant can I start to sort this out by asking if there is anyone here who has recently succeeded in installing ZEOS into Lazarus 1.0.12, FPC 2.6.2 or near enough for Windows 32.  It would be very helpful to have a pointer to clear, accurate, download and installation instructions which are known to work. The zip at http://sourceforge.net/projects/zeoslib/postdownload?source=dlp contains a lazarus package.  the wiki at http://wiki.freepascal.org/Zeos_tutorial says there is no official release for Lazarus yet and recommends using a SVN version.  I've tried both and I get different error messages. If I can start with a good set of instructions to follow, then I can give a blow-by-blow account of what happens when I try to follow those instructions and then hopefully someone can diagnose what is going wrong. Thank you. Caravelle (very frustrated  ) ---------------------------------------------------------------------- TraumTaenzerDieter · 2014-06-10 18:51 1) download zeos from here: http://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Object s/zeosdbo-7.1.3a-stable/ZEOSDBO-7.1.3a-stable.zip/download 2) open packages\lazarus\zcomponent.lpk and compile it 3) the menu "Use >> Install" and then recompile Lazarus After that you should have the entry "Zeos Access" on your components bar. I am using it with Window 7 32+64 bit, Lazarus 1.2.2, FPC 2.6.4 accessing a MySql database. ---------------------------------------------------------------------- fpcoder · 2014-06-10 23:21 Maybe I wasted time and could just compiled and installed ZComponent.lpk immediately then. Because I re-installed ZEOS by compiling in the following order:     ZCore.lpk     ZParseSql.lpk     ZPlain.lpk     ZDbc.lpk     ZComponent.lpk And then ZComponent.lpk: Use->Install-> Recompile Lazarus Anyway, ZEOS works fine. Quote from: TraumTaenzerDieter on June 10, 2014, 08:51:45 pm1) download zeos from here: http://sourceforge.net/projects/zeoslib/files/Zeos%20Database%20Object s/zeosdbo-7.1.3a-stable/ZEOSDBO-7.1.3a-stable.zip/download 2) open packages\lazarus\zcomponent.lpk and compile it 3) the menu "Use >> Install" and then recompile Lazarus After that you should have the entry "Zeos Access" on your components bar. I am using it with Window 7 32+64 bit, Lazarus 1.2.2, FPC 2.6.4 accessing a MySql database. ---------------------------------------------------------------------- mangakissa · 2014-06-11 07:51 I could, but I can't imagine, that ZEOS 7.1.3 isn't compatible with Lazarus 1.0.12. Just use version 6.6.6. I installed 7.1.3 on Lazarus 1.22 / FPC 2.6.4 without any problems. I'll go with kapibara and TraumTaenzerD ---------------------------------------------------------------------- JD · 2014-06-11 08:35 The newer Zeos versions did not retain backwards compatibility with old versions of Lazarus & Delphi. If you have any one of these, I would advise you to upgrade but if not you can download & install Zeos 6.6.5/6.6.6. These obviously don't have the most recent bug fixes but they are still very usable. JD ---------------------------------------------------------------------- Caravelle · 2014-06-11 12:42 Thanks for the replies. First I installed the latest Win32 Lazarus/FPC from Sourceforge.  That seems to have worked. I downloaded ZEOS again from the URL suggested - it's one of the same ones I tried yesterday. Quote2) open packages\lazarus\zcomponent.lpk and compile itClick "Package" from menu bar, select "Open package file (.lpk)...".   Select file "zcomponent.lpk" and Open.  Click "Compile". The attached screenshot was the result.   Compiler options ?  what should I be checking for please and where ?    I have only just installed this version of Lazarus and have not changed anything. Thank you Caravelle (even more frustrated !  ) ---------------------------------------------------------------------- mangakissa · 2014-06-11 14:09 It looks like your paths are incorrect. I've copied ZEOS in my special third party directory. So for it's c:\lazarus\third party\ZEOSDBO\packages\lazarus. Its very important you have all the directories and files in one directory. ---------------------------------------------------------------------- Caravelle · 2014-06-11 16:44 I downloaded the ZEOS zip.  I unzipped it to a new folder "C:\lazarus\ZEOSDBO".   I navigated to that folder and within that to "/packages/lazarus" and selected "zcomponent.lpk".    The "Readme.txt" in this folder says Quote"1.  Packages / Open Package File (*.lpk) 2.  Open ZComponents.Lpk (from directory containing this README) 3.  Click Compile 4.  Click Use -> Install 5.  Click Yes when asked if you want to rebuild Lazarus" I didn't get past "Compile". I have not touched any paths, there is only one folder  I have done nothing with Lazarus since installing the new version except try to install ZEOS.   Could there be something left over somewhere from one of the earlier attempts to install ZEOS?  If so, what and where? Thanks Caravelle ---------------------------------------------------------------------- JanRoza · 2014-06-11 20:22 I have two Lazarus installations, a 1.2.2  and a 1.3 and have installed ZEOS in both without any errors. The only difference is that I always install components in their own folder under ..\Lazarus\components. Why do you want to install third party components in a completely different location, if Lazarus has its components in the component subfolder why should third party components be installed there too? That surely is a location which Lazarus can find. The ZGroupedConnection.pas file is in the same folder as ZEOS's other sources so it should be found without problem. ---------------------------------------------------------------------- fpcoder · 2014-06-12 00:18 @Caravelle: In the beginning I think you tried some other version than the stable release. If the files from that non release version is still left on the disk somewhere, Lazarus might find them and that causes the problem. You re-installed Lazarus, but maybe you didnt check the option to delete old settings. If this is the problem then on Windows you could go to "c:\users\'myusername'\AppData\Local\Lazarus\" and delete the Lazarus configdir. Everything in there is recreated when you start Lazarus. Except your custom settings and 3rd party components. (AppData is a hidden dir, just type it in the explorer and go there) And just in case, delete all ZEOS files/dirs except your stable version. ---------------------------------------------------------------------- Caravelle · 2014-06-12 14:26 Thank you, kapibara. QuoteIn the beginning I think you tried some other version than the stable release. Yes, because I was foolish enough to believe the wiki, last modified in May 2014.  Someone needs to do something about that.  Quote(AppData is a hidden dir, just type it in the explorer and go there) Not hidden on my Vista system, I changed the default    Quotedelete the Lazarus configdir But I have nothing called "configdir" in AppData\Local\lazarus.  Were you telling me to delete the folder called "lazarus" ?   I am fairly sure by the dates of the files that everything here is new.  I also have a folder called "Lazarus Data Desktop", which judging by the 2013 date belongs to the previous installation. QuoteAnd just in case, delete all ZEOS files/dirs except your stable version. Done, even the downloaded zip file has been moved to a USB stick, unplugged after unzipping.  I have now put a "zeos" folder in the "lazarus\components" folder and the unzipped files are in that (can you tell me please precisely which files need be in this folder ? Most of the zipped files relate to Delphi and C++, there doesn't seem to be much point in keeping them.) And now to try installing Zeos again.  I followed what you, kapibara, said you did, even if it was long-winded.  And eventually.....after some long heart-stopping pauses Lazarus re-opened with a "Zeos Access" tab.  So thank you very much for your help.    Now I just have to find some guidance on using Zeos in Lazarus and start all over again with the programs I had written based on the built-in sqlite facilities.  It looks like being a long slog, and I think you can expect a lot more questions here ! Caravelle (less frustrated now but much time wasted) ---------------------------------------------------------------------- fpcoder · 2014-06-12 18:48 @Caravelle: Glad it worked. AppData\Lazarus is the default configdir, and yes, I suggested to delete that. No need to do that now since the problem is gone. SQLdb is Lazarus answer to Delphi DBExpress. If you instead of SQLite use FireBird embedded or PostGres, MariaDB etc, then there is no problem with simultaneous read/writes. I hope SQLdb will be developed even more, especially to support SQLite concurrency. Because SQLdb is quite nice. Before you devote too much time to ZEOS, make sure that it meets your expectations regarding concurrency. Can files under ZEOS install be removed? Dont know.  You could of course try by moving them and put them back if it doesn't compile afterwards. Also remember that Lazarus and Free Pascal are OpenSource projects. If you learn something useful and think its important, then go ahead and add it to the WIKI as a contribution to the project. You see, those who answer questions in the forum don't have time to maintain everything in the wiki themselves. And the core of developers must focus mainly on the development of Lazarus and FPC. ---------------------------------------------------------------------- devEric69 · 2015-08-18 08:20 Quote from: kapibara on June 11, 2014, 01:21:43 amMaybe I wasted time and could just compiled and installed ZComponent.lpk immediately then. Because I re-installed ZEOS by compiling in the following order:     ZCore.lpk     ZParseSql.lpk     ZPlain.lpk     ZDbc.lpk     ZComponent.lpk And then ZComponent.lpk: Use->Install-> Recompile Lazarus Anyway, ZEOS works fine. Thank you to share: I'm trying to convert an application from Delphi 32bits towards Lazarus (using Lazarus 1.4.2 32bits and ZEOSDBO-7.1.3a-stable). With your method, this installs flawlessly  . ---------------------------------------------------------------------- christensen · 2016-12-08 20:21 Hi i'm trying to install Zeoslib 7.3 test version on Lazarus 1.6.2 but i got this error during compiling: QuoteZDbcPostgreSqlResultSet.pas(193,11) Error: overloaded functions have the same parameter list ZDbcPostgreSqlResultSet.pas(167,11) Error: Found declaration: pgSQLStrToFloatDef(PChar;const Double;var Double); ZDbcPostgreSqlResultSet.pas(180,11) Error: Found declaration: pgSQLStrToFloatDef(PChar;const Double;var Single); I've tried 7.2 but the same errors. ---------------------------------------------------------------------- ttomas · 2016-12-09 00:38 You try to install on 64bit version. Try 32bit lazarus. I have the same problem see http://synopse.info/forum/viewtopic.php?id=3661 ---------------------------------------------------------------------- dogriz · 2016-12-09 09:56 Or just delete one of the functions. Worked for me. ---------------------------------------------------------------------- christensen · 2016-12-12 13:29 Yes i've tried to install 64bit version. Now i will try to install the 32bit one. Thanks ---------------------------------------------------------------------- marsupilami79 · 2016-12-12 19:22 Hello christensen, dogriz, ttomas, it seems I forgot to include a conditinal compile here for one of the pgSQLStrToFloatDef functions. I will change that tomorrow (Tuesday) evening since I want to / have to push the patch through the test suite and cannot do that now. It would be nice to hear about that kind of problems in the Zeos forums or on the Zeos bug tracker, since it is hard for me and other Zeos team members to follow all relevant pascal forums With best regards, Jan ---------------------------------------------------------------------- Thaddy · 2016-12-13 08:06 Quote from: christensen on December 08, 2016, 09:21:19 pmQuoteZDbcPostgreSqlResultSet.pas(193,11) Error: overloaded functions have the same parameter list ZDbcPostgreSqlResultSet.pas(167,11) Error: Found declaration: pgSQLStrToFloatDef(PChar;const Double;var Double); ZDbcPostgreSqlResultSet.pas(180,11) Error: Found declaration: pgSQLStrToFloatDef(PChar;const Double;var Single); I've tried 7.2 but the same errors. That looks like a compiler bug. The parameter list is obviously NOT the same. Also, when I write some pseudo code as a test it does compile correctly in trunk, so maybe you should upgrade your compiler. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program overloadok; function pgSQLStrToFloatDef(S:PChar;const D:Double;var R: Double):boolean;overload;begin  Result :=true;end; function pgSQLStrToFloatDef(S:PChar;const D:Double;var R:Single):Boolean;overload;begin  Result :=true;end;beginend.  [edit] You must upgrade your compiler and you must upgrade Lazarus too. I see you use Lazarus 1.0.12, FPC 2.6.2  which are both unsupported and really old. ---------------------------------------------------------------------- marsupilami79 · 2016-12-13 17:46 Hello christensen, dogriz, ttomas, Thaddy, I applied a patch to solve these problems to the Zeos 7.2 SVN on Sourceforge. Could you please confirm that this fixes the bug? It works for me. @Thaddy: This bug really happens under the current Lazarus (1.6.2) with FPC 3.0.0 for Windows on X64 although I don't understand (yet) why. The FPC 3.0.0 Programmer’s Guide says: QuoteFor Intel 80x86 processors, the extended type has takes up 10 bytes of memory space. For more information on the extended type consult the Intel Programmer’s reference. For all other processors which support floating point operations, the extended type is a nickname for the type which supports the most precision, this is usually the double type. On processors which do not support co-processor operations (and which have the {$E+} switch), the extended type usually maps to the single type.So the behaviour would make sense if FPC doesn't support the extended type for X64 or X64 generally doesn't support the extended type. With best regards, Jan ---------------------------------------------------------------------- ttomas · 2016-12-13 20:32 @Thaddy This is FPC64 bug in trunk. I have same problem with new NewPascal/fcupdeluxe 64 bit install. Same code with 32bit FPC compile without problem. Look like Single=Double in FPC64!!! Any coment. ---------------------------------------------------------------------- Thaddy · 2016-12-13 20:55 As I wrote, it is a compiler bug (except for extended, that is documented as double on 64 bit, so renders the same signature. That is inevitable). But the original shows a double and a single as I highlighted in the original quote, If X86_64 refuses that, that is definitely a compiler bug. Plz report it. BTW: NewPascal is NOT FPC trunk. BTW 2: there is a define FPC_HAS_TYPE_EXTENDED that you can also use in your own code to distinguish between systems that have real Extended or not. Look in math.pp on how to use it. It is not global. ---------------------------------------------------------------------- christensen · 2016-12-14 14:03 Hi marsupilami79, It works! lazarus 1.6.2 FPC 3.0, w7 x64 Thanks ---------------------------------------------------------------------- hnb · 2016-12-15 11:23 Quote from: Thaddy on December 13, 2016, 09:55:00 pmBTW: NewPascal is NOT FPC trunk. BTW: Generally true. NewPascal has additional branch "freepascal" which is pure mirror of FPC trunk : https://github.com/newpascal/freepascal/tree/freepascal