[patch_done] compile Linux Lazarus testing-egonhugeist r1055

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

[patch_done] compile Linux Lazarus testing-egonhugeist r1055

Post by ism »

Not compile in Linux lazarus 0.9.30.2 fpc 2.4.4 testing-egonhugeist rev 1055

/home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas(202,14) Warning: An inherited method is hidden by "TZAbstractObject.Equals(const IUnknown):Boolean;"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas(203,40) Warning: An inherited method is hidden by "TZAbstractObject.GetHashCode:LongInt;"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas(205,14) Warning: An inherited method is hidden by "TZAbstractObject.ToString:AnsiString;"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(134,13) Hint: Type "HMODULE" redefinition
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(193,58) Warning: Some fields coming after "ZAlias" weren't initialized
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(202,52) Hint: Parameter "CP" not used
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(203,47) Hint: Parameter "CP" not used
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(204,47) Hint: Parameter "CP" not used
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(745,27) Error: Identifier not found "dlopen"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(750,29) Error: Identifier not found "dlclose"

/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(750,30) Hint: Conversion between ordinals and pointers is not portable
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(755,18) Error: Identifier not found "dlsym"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(755,19) Hint: Conversion between ordinals and pointers is not portable
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(829) Fatal: There were 3 errors compiling module, stopping
wylton
Senior Boarder
Senior Boarder
Posts: 58
Joined: 14.07.2011, 20:56

Post by wylton »

ZClasses.pas has modification。。windows and linux not compiler.
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

Remove the ifdef around gethashcode in interface and implementation
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Done Rev. 1056...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

no effect
error in this place
$IFDEF UNIX}
{$IFDEF FPC}
function LoadLibrary(ModuleName: PChar): HMODULE;
begin
Result := HMODULE(dlopen(Modulename, RTLD_GLOBAL));
end;
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.4.4 [2011/09/28] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Linux for i386
Compiling zcore.pas
Compiling /home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas(202,14) Warning: An inherited method is hidden by "TZAbstractObject.Equals(const IUnknown):Boolean;"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas(203,14) Warning: An inherited method is hidden by "TZAbstractObject.GetHashCode:LongInt;"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZClasses.pas(205,14) Warning: An inherited method is hidden by "TZAbstractObject.ToString:AnsiString;"
Compiling /home/client20/bin/zeos/testing-egonhugeist/src/core/ZMessages.pas
Writing Resource String Table file: ZMessages.rst
Compiling /home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(134,13) Hint: Type "HMODULE" redefinition
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(193,58) Warning: Some fields coming after "ZAlias" weren't initialized
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(202,52) Hint: Parameter "CP" not used
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(203,47) Hint: Parameter "CP" not used
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(204,47) Hint: Parameter "CP" not used
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(745,27) Error: Identifier not found "dlopen"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(750,29) Error: Identifier not found "dlclose"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(750,30) Hint: Conversion between ordinals and pointers is not portable
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(755,18) Error: Identifier not found "dlsym"
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(755,19) Hint: Conversion between ordinals and pointers is not portable
/home/client20/bin/zeos/testing-egonhugeist/src/core/ZCompatibility.pas(829) Fatal: There were 3 errors compiling module, stopping
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

:wallb:

Grrrr,
ok did it hopefully. I ask the man who did this FPC2.6+ job again if it doesn't work..

Rev. 1060
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

in fpc 2.4.4 and Lazarus 0.9.30.2 unit dlopen replace unit dl http://wiki.freepascal.org/Lazarus/FPC_Libraries

in fpc 2.6.0 i do not know , i try



temporary patch

Code: Select all

Index: src/core/ZCompatibility.pas
===================================================================
--- src/core/ZCompatibility.pas	(revision 1060)
+++ src/core/ZCompatibility.pas	(working copy)
@@ -61,7 +61,7 @@
   Variants,
 {$IFDEF UNIX}
   {$IFDEF FPC}
-    dynlibs,
+    dl,
   {$endif}
    {$ifdef kylix}
     libc,
But new error in Linux Lazarus

Code: Select all

unit ZPgEventAlerter;

interface
{$i zcomponent.inc}
uses   

Code: Select all

/home/client20/bin/zeos/testing-egonhugeist/src/component/ZPgEventAlerter.pas(51,2) Fatal: Can't open include file "zcomponent.inc"
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

Last error: yes, I'm not used to these issues, since Lazarus and FPC projects have all their files in lowercase (and lowercase is always matched by FPC). Fixed, r1061.

First error, this is more difficult. The "dl" unit is less portable than the dynlibs unit, and might cause problems.

The dynlibs unit however exports "windows" style "loadlibrary" and "getprocadddres" symbols on all platforms.

The change back to "dl" is only a temporary one (only good for certain core *nix platforms, not the more freak ones), so in time "dynlibs" is better, but some issues (e.g. the library handle handle type, which can't be THandle or HModule and dlopen options (dynlibs uses RTLD_LAZY instead of _GLOBAL)) must be researched more before a definitive change is made.

The best solution would be to introduce a handle type for dlls, and alias it to HModule on Delphi and Kylix and dynlibs.TLibHandle on FPC, and use that everywhere where loadlib is used.
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

in Unix in a case of the character has the importance

patch
--- src/component/ZPgEventAlerter.pas (revision 1060)
+++ src/component/ZPgEventAlerter.pas (working copy)
@@ -48,7 +48,7 @@
unit ZPgEventAlerter;

interface
-{$i zcomponent.inc}
+{$i ZComponent.inc}
uses
SysUtils, Classes, ExtCtrls,
{$IFDEF MSWINDOWS}
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Thank you ism and marcov.

Done in testing-egonhugeist 1062 too.

Marco can you work out the DynLibs-issues too?

Best regards
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

In testing it already is "dl", so I guess sb else fixed it?
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

Patch dlopen , it is example, possible do better

please verify

Lazarus 0.9.30.4 fpc 2.6.0 Linux working

Code: Select all

Index: src/core/ZCompatibility.pas
===================================================================
--- src/core/ZCompatibility.pas	(revision 1062)
+++ src/core/ZCompatibility.pas	(working copy)
@@ -742,17 +742,17 @@
   {$IFDEF FPC}
 function LoadLibrary(ModuleName: PChar): HMODULE;
 begin
-  Result := HMODULE(dlopen(Modulename, RTLD_GLOBAL));
+  Result := dynlibs.LoadLibrary (ModuleName);//  HMODULE(dlopen(Modulename, RTLD_GLOBAL));
 end;
 
 function FreeLibrary(Module: HMODULE): LongBool;
 begin
-  Result := longbool(dlclose(pointer(Module)));
+  Result := dynlibs.FreeLibrary(Module); //longbool(dlclose(pointer(Module)));
 end;
 
 function GetProcAddress(Module: HMODULE; Proc: PChar): Pointer;
 begin
-  Result := dlsym(pointer(Module), Proc);
+  Result := dynlibs.GetProcAddress (Module,Proc) //dlsym(pointer(Module), Proc);
 end;
   {$ENDIF}
 {$ENDIF}
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

ism,

did you check this on windows too?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

see IFDEF
{$IFDEF UNIX}
{$IFDEF FPC}
function LoadLibrary(ModuleName: PChar): HMODULE;
begin
Result := dynlibs.LoadLibrary (ModuleName);
end;
this code seen and compile only on unix fpc

in windows all ok

Check everything in Virtualbox Opensuse
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

ism,

commit your patch Rev. 1063. Thank you. That's what we need.

Best regards
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Locked