Page 1 of 3

Solution for ZEOS 6.6.6 with >= FPC2.5.x

Posted: 07.01.2011, 15:04
by mmvisual
Hello,
I have change to FPC 2.5.1 and then I cannot install the componente V6.6.6, there comes a error.

Then I have change in the File "ZClasses.pas" the lines:
TContainedObject = class(TAggregatedObject, IInterface)
protected
function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
// function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
end;

and here:
function TContainedObject.QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
//function TContainedObject.QueryInterface(const IID: TGUID; out Obj): HResult;
begin
if GetInterface(IID, Obj) then
Result := S_OK
else
Result := E_NOINTERFACE;
end;

Now, it works fine.
In atachment the corrected file.

@Admin: Can you generate a Release V6.6.7, that works with FPC 2..5.x?

Thanks, Markus.

Posted: 08.01.2011, 18:04
by Wild_Pointer
Hello, mmvisual,

there's already a topic about the problem of FPC >= 2.5. http://zeos.firmos.at/viewtopic.php?t=3 ... hlight=fpc Have you read it?

Also have you tried compiling zeos lib on lower FPC version with your changes applied. Is it backwards compatible?
Didn't you have to also change _AddRef and _Release methods ?

Good luck!

Posted: 08.01.2011, 21:06
by mmvisual
Hello,

Sorry, I have not read the thread.

I have test it with:

- Lazarus-0.9.29-28634-fpc-2.4.2-20101206-win32.exe
- Lazarus-0.9.31-28871-fpc-2.5.1-20110106-win32.exe

With both versions work my change correct. No other change is required.

If you can german, vou can read here:
http://www.lazarusforum.de/viewtopic.php?p=43969#p43969
This was my first installation with the new FPC and I have correct the Zeos-Mistake in 5 minutes. I want not read a lot of threads, what I can correct self in this short time.

Regards, Markus

Posted: 13.01.2011, 22:06
by mdaems
mmvisual,
Can you check the changes needed to the zclasses file I attach to this post? That's the version in the 6.6 branch right now.
Did you also test on linux?

Mark

Posted: 14.01.2011, 09:46
by mmvisual
I have correct the file an test. It have not work with my Linux-Test.

The Test:
Windows + FPC2.4.2 + L0.9.29 > OK (MySQL)
Windows + FPC2.5.1 + L0.9.31 > OK (MySQL)
Linux + FPC2.4.2 + L0.9.29 > OK (SQLite)

It need a test with Linux and FPC >= 2.5.0.

Here the File:

Posted: 14.01.2011, 10:29
by Wild_Pointer
mdaems,

in line 218 of the file you send is a line

Code: Select all

function TAggregatedObject._Release: Integer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
Do you know why is it there? I meen the calling directives. mmvisual removed them and I think the source is better now. On the other hand if they are needed for some reason, then they should be copied from the declaration.

Posted: 25.01.2011, 20:16
by mmvisual
Hello,

My changes from Posted: 14.01.2011, 10:46 woking with FPC2.5.1/Laz0.9.31 with Linux correct, I have test it today.

@mdaems
You can make a new release V6.6.7

Markus

Posted: 27.01.2011, 00:33
by mdaems
Committed to rev. 877 and 878

Now I hope lots of people try the preview of 6.6.7 I uploaded to the snapshot server.

Mark

Posted: 27.01.2011, 08:31
by mmvisual
I have installed a new linux, then I have found a new problem. After installing all, I have want made a test mit MySQL. In Ubuntu, I have must install:

sudo apt-get install mysql-client

After this installation was there in "/usr/lib/" the file "libmysqlclient.so.16" but the ZEOS Component want have "libmysqlclient.so.15".

I have add this file into "ZPlainMySql5.pas", see attachment. Line 83, 593.

(Or you can make a new link with
ls -s /usr/lib/libmysqlclient.so.16 /usr/lib/libmysqlclient.so.15
then ist works with the old zeos, too)

But I think it was better, when you can make this small change into 6.6.7.

Markus.

Posted: 27.01.2011, 20:33
by mmvisual
@mdaems
can you make a new ZIP-Download "V6.6.7alpha" on this side?
http://zeos.firmos.at/portal.php

And open a new forum section "V6.6.7"?

Then I think more users can write here thinks and help to make a V6.6.7.

Thank you very much,
Markus

Posted: 18.03.2011, 08:34
by tintinux
After this installation was there in "/usr/lib/" the file "libmysqlclient.so.16" but the ZEOS Component want have "libmysqlclient.so.15".
Hi,

This issue was already raised and corrected.
See this post.

Regards,
Tintinux

Posted: 18.03.2011, 09:13
by tintinux
Now I hope lots of people try the preview of 6.6.7 I uploaded to the snapshot server
Yes, I would like to try... but where can we find it ?
Thanks
Tintinux

Posted: 21.03.2012, 20:16
by Alex Rosa
tintinux wrote:Yes, I would like to try... but where can we find it ?
Thanks
Tintinux
http://zeosdownload.firmos.at/downloads ... stable.zip

Posted: 26.03.2012, 15:35
by tintinux
Hi

Thanks for the link. It is never too late...

I have just tried with Lazarus 0.9.30.4 and FPC 2.6 on Windows.

There are compilation errors in ZClasses.pas

G:\Lazarus\Tiers\Zeos\preview-ZEOSDBO-6.6.7-stable\src\core\ZClasses.pas(90,22) Error: No matching implementation for interface method "IUnknown.QueryInterface(constref TGuid,out <Formal type>):LongInt; StdCall;" found
G:\Lazarus\Tiers\Zeos\preview-ZEOSDBO-6.6.7-stable\src\core\ZClasses.pas(194,14) Warning: An inherited method is hidden by "TZAbstractObject.Equals(const IUnknown):Boolean;"
G:\Lazarus\Tiers\Zeos\preview-ZEOSDBO-6.6.7-stable\src\core\ZClasses.pas(197,14) Warning: An inherited method is hidden by "TZAbstractObject.ToString:AnsiString;"
G:\Lazarus\Tiers\Zeos\preview-ZEOSDBO-6.6.7-stable\src\core\ZClasses.pas(201,1) Fatal: There were 1 errors compiling module, stopping

I have read that there were changes in FPC 2.6... but I can't find more information.

:twisted:

Regards,
Tintinux

Posted: 26.06.2012, 12:16
by msv
Just wanted to post and say that the first post plus adding the following to my zeos.inc file allowed me to compile 7.0.0-alpha using Lazarus v.0.90.4 (which uses FPC 2.6) on my Mac.

Code: Select all

{$IFDEF VER2_6}
    {$DEFINE FPC2_3UP}
    {$DEFINE FPC2_2UP}
    {$DEFINE FPC2_1UP}
  {$ENDIF}