Recent

Author Topic: Problems with lazarus fixes + zeoslib  (Read 21942 times)

calebs

  • Full Member
  • ***
  • Posts: 161
Problems with lazarus fixes + zeoslib
« on: April 13, 2012, 04:01:00 pm »
* had to make it in parts can't post all together

Hello all i've searching all forums but i can't find the solution to this, a lot of people with this problem (or something like) but i cannot solve.
Here is the scenario:
Im working on a set of programs with lazarus 9.30 in two machines, one with windows 7 64 bits and other with debian 6.03 32 bits and the files and mysql database are on a third computer (ubuntu server), and zeoslib 6.6.6 stable.
After solve a lot of problems with include paths and units hell could solve it and all worked fine.
The problem starts when i download Lazarus-0.9.31-36732-fpc-2.6.0-20120412-win32 (latest build from server guess), I renamed old lazarus folder and old lazarus folder into user settings (haven't tried on linux yet) and installed fresh new lazarus. When i try to install zeos 6.6.6 package happens this:

calebs

  • Full Member
  • ***
  • Posts: 161
Re: Problems with lazarus fixes + zeoslib
« Reply #1 on: April 13, 2012, 04:05:04 pm »
Code: [Select]
....
ZAbstractRODataset.pas(214,30) Hint: Parameter "Sender" not used
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(276,33) Hint: Parameter "Buffer" not used
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(276,50) Hint: Parameter "Append" not used
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2214,16) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2450,18) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2489,16) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2558,14) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2588,14) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2646,34) Hint: Local variable "RowBuffer" does not seem to be initialized
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(291,25) Hint: Parameter "Field" not used
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2695,16) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2741,39) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2756,13) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2756,30) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2756,13) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2756,30) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2773,12) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2782,12) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2806,35) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(2806,51) Hint: Conversion between ordinals and pointers is not portable
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(3116,48) Error: Expected another 2 array elements
D:\Sistemas\ZEOSDBO-6.6.6-stable\packages\lazarus\ZAbstractRODataset.pas(3263) Fatal: There were 1 errors compiling module, stopping

the error is in this procedure procedure TZAbstractRODataset.CheckFieldCompatibility(Field: TField;FieldDef: TFieldDef) in TZAbstractRODataset

Code: [Select]
const
  BaseFieldTypes: array[TFieldType] of TFieldType = (
    ftUnknown, ftString, ftInteger, ftInteger, ftInteger, ftBoolean, ftFloat,
    ftFloat, ftBCD, ftDateTime, ftDateTime, ftDateTime, ftBytes, ftVarBytes,
    ftInteger, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftUnknown,
    ftString, ftString, ftLargeInt, ftADT, ftArray, ftReference, ftDataSet,
    ftBlob, ftBlob, ftVariant, ftInterface, ftInterface, ftString, ftTimeStamp, ftFMTBcd
    {$IFDEF FPC2_1UP}, ftString, ftBlob{$ENDIF}); 

And won't install and rebuild with lazarus.
Tried with downloaded 6.6.7 and 7.0.1-alpha and won't compile either. Also tried to download codetyphon but when i open any project with it it tells me that i can't find zcomponent 6.6.6 and i don't want to rebuild all the programs again or edit them manually.
Is there any workaround to this? I want to can upgrade lazarus sometime (if i rollback to the old backuped lazarus folder everything work fine)

Excuse the long post, thanks

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Problems with lazarus fixes + zeoslib
« Reply #2 on: April 13, 2012, 04:28:58 pm »
Code: [Select]
const
  BaseFieldTypes: array[TFieldType] of TFieldType = (
    ftUnknown, ftString, ftInteger, ftInteger, ftInteger, ftBoolean, ftFloat,
    ftFloat, ftBCD, ftDateTime, ftDateTime, ftDateTime, ftBytes, ftVarBytes,
    ftInteger, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftUnknown,
    ftString, ftString, ftLargeInt, ftADT, ftArray, ftReference, ftDataSet,
    ftBlob, ftBlob, ftVariant, ftInterface, ftInterface, ftString, ftTimeStamp, ftFMTBcd
    {$IFDEF FPC2_1UP}, ftString, ftBlob{$ENDIF}); 

This looks like the old 6.6.6 code. Version 7.0.0-dev has fixed a lot of the problems with lazarus and fpc. You can get it from svn from https://zeoslib.svn.sourceforge.net/svnroot/zeoslib/trunk.

If you want to use the old zeos code with fpc 2.6.0 you can fix this problem by changing zeos.inc and adding the following at line 53 just before {$IFDEF VER2_5}:
Code: [Select]
{$IFDEF VER2_6}
    {$DEFINE FPC2_3UP}
    {$DEFINE FPC2_2UP}
    {$DEFINE FPC2_1UP}
  {$ENDIF}



calebs

  • Full Member
  • ***
  • Posts: 161
Re: Problems with lazarus fixes + zeoslib
« Reply #3 on: April 13, 2012, 05:26:16 pm »
thanks ludo i'll try that.
I have tried to use preview-ZEOSDBO-7.0.1-alpha (is that version the one you tell me?)
But i can't remember if i could integrate to lazarus... and then, i have the other problem later, when i open one of the programs (lpi) and tried to compile it tells me that zcomponent 6.6 is not found (there is 7 but there are not compatible i guess) happened with codetyphoon one of the times i tried

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Problems with lazarus fixes + zeoslib
« Reply #4 on: April 13, 2012, 06:02:27 pm »
Quote
I have tried to use preview-ZEOSDBO-7.0.1-alpha (is that version the one you tell me?)
No. That dates from September last year. fpc 2.6.0 didn't exist then. Recently several problems with fpc have been solved in Zeoslib (changes in QueryInterface definition for example). You can find the most recent version in the link I gave you. Zeos changed the svn repository in march I believe.
Quote
But i can't remember if i could integrate to lazarus... and then, i have the other problem later, when i open one of the programs (lpi) and tried to compile it tells me that zcomponent 6.6 is not found (there is 7 but there are not compatible i guess) happened with codetyphoon one of the times i tried
The svn version I downloaded last week installed without any problems with lazarus and  fpc 2.6.0.

Codetyphon uses their own fixed up version of Zeos . Last time I used Codetyphon the package was called pl_zeosdbocomp 6.6.6.1. Installing from svn gives a package called zcomponent 7.0. Moving a project from Codetyphon to Lazarus can indeed give problems with dependencies because of the different packages.

calebs

  • Full Member
  • ***
  • Posts: 161
Re: Problems with lazarus fixes + zeoslib
« Reply #5 on: April 13, 2012, 10:47:55 pm »
You say that if i download that link you gave me ludob (btw i don't have subversion, how i download all archives from there?) it will install as zeos 6.6.6 or zeos 7? i don't have problems with the name of the component changed?

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Problems with lazarus fixes + zeoslib
« Reply #6 on: April 15, 2012, 09:10:35 am »
Sorry for the late reply. I didn't notice your question.

At the bottom of http://zeoslib.svn.sourceforge.net/viewvc/zeoslib/trunk/ you'll find the link 'Download GNU tarball'. This gives you all the files in one tar.gz file. If you are on windows you can open it with 7zip, winrar, etc.

Installing zcomponent.lpk will install zeos 7.0.0. Uninstall you exisitng zeos package before installing the 7.0.0 and if you have been using pl_zeosdbocomp in your projects before you'll need to change the requiored packages in the project inspector.

calebs

  • Full Member
  • ***
  • Posts: 161
Re: Problems with lazarus fixes + zeoslib
« Reply #7 on: April 16, 2012, 10:44:04 pm »
thanks ludob i've downloaded turtlesvn and then download the zeosdbo and installed lazarus 9.31 fixes from .hu and then installed zeos 7 to lazarus opened a project made with 6 and compiled fine (and worked) in windows.
Now i downloaded fpc 2.6 and lazarus sources from .hu for linux, after a long fight got working fpc and lazarus.
Now when i try to add the same package of zeos to lazarus won't compile.
It gives me this
Code: [Select]
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZClasses.pas(203,14) Warning: An inherited method is hidden by "TZAbstractObject.GetHashCode:LongInt;"
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZCompatibility.pas(144,27) Error: Identifier not found "dlopen"
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZCompatibility.pas(149,29) Error: Identifier not found "dlclose"
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZCompatibility.pas(149,30) Hint: Conversion between ordinals and pointers is not portable
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZCompatibility.pas(154,18) Error: Identifier not found "dlsym"
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZCompatibility.pas(154,19) Hint: Conversion between ordinals and pointers is not portable
/home/multisistema/lazarus-new/zeos_SVN/src/core/ZCompatibility.pas(216) Fatal: There were 3 errors compiling module, stopping
any hint?

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Problems with lazarus fixes + zeoslib
« Reply #8 on: April 17, 2012, 09:20:29 am »
In src/core/ZCompatibility.pas change line 63 and further from:
Code: [Select]
  {$IFDEF FPC}
    dynlibs,
  {$endif}
to
Code: [Select]
  {$IFDEF FPC}
    dl,
  {$endif}


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9994
  • FPC developer.
Re: Problems with lazarus fixes + zeoslib
« Reply #9 on: April 17, 2012, 11:59:50 am »
In src/core/ZCompatibility.pas change line 63 and further from:
Code: [Select]
  {$IFDEF FPC}
    dynlibs,
  {$endif}
to
Code: [Select]
  {$IFDEF FPC}
    dl,
  {$endif}

That's the wrong fix. It follows the Kylix code path, the right way to fix it (for all *nix) is to keep dynlibs and let it follow a more Windows like path via dynlibs. IIRC this is fixed in the testing branch, (to which I committed some FPC fixes), but I remember having some doubts about the constants used in dlload, so maybe I didn't commit it

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Problems with lazarus fixes + zeoslib
« Reply #10 on: April 17, 2012, 01:59:56 pm »
That's the wrong fix. It follows the Kylix code path, the right way to fix it (for all *nix) is to keep dynlibs and let it follow a more Windows like path via dynlibs. IIRC this is fixed in the testing branch, (to which I committed some FPC fixes), but I remember having some doubts about the constants used in dlload, so maybe I didn't commit it
In the latest zeos trunk, FPC does not follow the Kylix path since the Kylix path uses loadlibrary etc. from libc. The FPC path defines loadlibrary etc. as:
Code: [Select]
function LoadLibrary(ModuleName: PChar): HMODULE;
begin
  Result := HMODULE(dlopen(Modulename, RTLD_GLOBAL));
end;

function FreeLibrary(Module: HMODULE): LongBool;
begin
  Result := longbool(dlclose(pointer(Module)));
end;

function GetProcAddress(Module: HMODULE; Proc: PChar): Pointer;
begin
  Result := dlsym(pointer(Module), Proc);
end;
while dynlib does (removed non Unix stuff and reordered for clarity):
Code: [Select]
Function LoadLibrary(const Name : AnsiString) : TLibHandle;
begin
  Result:=TLibHandle(dlopen(Pchar(Name),RTLD_LAZY));
end;

Function GetProcAddress(Lib : TlibHandle; const ProcName : AnsiString) : Pointer;
begin
  Result:=GetProcedureAddress(Lib,Procname);
end;

Function GetProcedureAddress(Lib : TLibHandle; const ProcName : AnsiString) : Pointer;
begin
  Result:=dlsym(lib,pchar(ProcName));
end;

Function FreeLibrary(Lib : TLibHandle) : Boolean;
begin
  Result:=UnloadLibrary(lib);
end;

Function UnloadLibrary(Lib : TLibHandle) : Boolean;
begin
  Result:=dlClose(Lib)=0;
end;

Other than pchar/ansistring the only difference is RTLD_LAZY vs RTLD_GLOBAL. Not having RTLD_LAZY is a performance only thing, but dropping RTLD_GLOBAL is not neutral. Don't know if it is needed for Zeoslib, but removing without knowing is IMHO dangerous.

Dynlibs was in the uses clause, so perhaps there was a good reason for the Zeos redefinition. Perhaps it is just work in progress. It is trunk after all. In any case, I still consider adding dl to the uses clause as the safest option.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9994
  • FPC developer.
Re: Problems with lazarus fixes + zeoslib
« Reply #11 on: April 17, 2012, 04:09:14 pm »
That's the wrong fix. It follows the Kylix code path, the right way to fix it (for all *nix) is to keep dynlibs and let it follow a more Windows like path via dynlibs. IIRC this is fixed in the testing branch, (to which I committed some FPC fixes), but I remember having some doubts about the constants used in dlload, so maybe I didn't commit it
In the latest zeos trunk,

Trunk is not the latest. Trunk is like the "stable" of 7.0.  testing and the  testing-egonhugeist branch are the active ones. Marc merges from them time to time.

Quote
Other than pchar/ansistring the only difference is RTLD_LAZY vs RTLD_GLOBAL. Not having RTLD_LAZY is a performance only thing, but dropping RTLD_GLOBAL is not neutral. Don't know if it is needed for Zeoslib, but removing without knowing is IMHO dangerous.

Possibly a problem on OS X yes, but I assume that would have surfaced with fcl-db related modules already, so this is worth the risk.

The trouble is that it should reuse FPC libhandle definition, and not define its own.

calebs

  • Full Member
  • ***
  • Posts: 161
Re: Problems with lazarus fixes + zeoslib
« Reply #12 on: April 17, 2012, 04:10:10 pm »
Thanks ludob i've made that correction and now i can install zeos component... but have to revert that line when i want to add to windows again?

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Problems with lazarus fixes + zeoslib
« Reply #13 on: April 17, 2012, 04:14:56 pm »
Thanks ludob i've made that correction and now i can install zeos component... but have to revert that line when i want to add to windows again?
No. The line before says {$IFDEF UNIX}. So this change only affects unix.

calebs

  • Full Member
  • ***
  • Posts: 161
Re: Problems with lazarus fixes + zeoslib
« Reply #14 on: April 17, 2012, 11:00:50 pm »
Thanks to all !!!!
it's working... I will keep this post open for a while but if more problems appear
For now things are solved.

 

TinyPortal © 2005-2018