problem with zeosdbo-6.6.4 on winCE

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

dolang
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 16.04.2009, 06:44

problem with zeosdbo-6.6.4 on winCE

Post by dolang »

Hi,
use zeosdbo-6.6.4 on win32,the programe run ok,but on winCE,the programe not run,only change target OS ,target Cpu and LCL Widget for WINCE.why? thinks.
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Probably because Zeos does not support WinCE, just Win32
dolang
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 16.04.2009, 06:44

Post by dolang »

zeosdbo-6.6.4 support winCE.
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Are you sure? Can you provide a citation?
dolang
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 16.04.2009, 06:44

Post by dolang »

what citation do I provide?
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

That zeosdbo-6.6.4 supports winCE. I never heard about it, but I'm very interested if it works.
dolang
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 16.04.2009, 06:44

Post by dolang »

I see the examples of zeosdbo-6.6.3 develope CE programe.
dolang
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 16.04.2009, 06:44

Post by dolang »

use lazarus and zeosdbo can develope CE programe.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Yes,

I believe there's a possibility to compile CE programs when using FPC/Lazarus, but I have no idea if this is working or not. I remember we once removed some assembler code to avoid crossbuilding problems on FPC. I don't have CE and I wonder if any active zeoslib member has experience with this OS.
A possible reasons for failure I can imagine : dll interfaces that differ between CE and regular windows versions.

Mark
Image
nicolagorlandi
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 18.05.2009, 08:19

Post by nicolagorlandi »

I try to use ZeosLib on wince with Lazarus. I've met some problem:

a) Compiler error, in details in ZplainLoader unit in the
function TZNativeLibraryLoader.LoadNativeLibrary I made this fix (only for right compiling)

From
Handle := LoadLibrary(PChar(Location));
to
{$IFDEF WINCE}
Handle := LoadLibrary(PWideChar(Location));
{$ELSE}
Handle := LoadLibrary(PChar(Location));
{$ENDIF}


and from
function TZNativeLibraryLoader.GetAddress(ProcName: PChar): Pointer;
begin
Result := GetProcAddress(Handle, pchar(ProcName));
end;
to
function TZNativeLibraryLoader.GetAddress(ProcName: PChar): Pointer;
begin
{$IFDEF WINCE}
Result := GetProcAddress(Handle, pWidechar(ProcName));
{$ELSE}
Result := GetProcAddress(Handle, pchar(ProcName));
{$ENDIF}
end;

another problem is in Zabstractrwodataset unit where the line

{$IFNDEF UNIX}
if doOemTranslate in FOptions then
begin
if ToOem then
CharToOem(Src, Dest)
else OemToChar(Src, Dest);
Dest[Result] := #0;
end
else
{$ENDIF}

goes in error (Chartoem and Oemtochar not fuond).

I add a compiler directive like this

{$IFNDEF WINCE}
{$IFNDEF UNIX}
if doOemTranslate in FOptions then
begin
if ToOem then
CharToOem(Src, Dest)
else OemToChar(Src, Dest);
Dest[Result] := #0;
end
else
{$ENDIF}
{$ENDIF}

and the compiler didn't return error. Then I run my project with a form within a Zconnection object with sqlite-3. when I run the app on Wince I get on error

Ebuserror: Bus error on misaligned data access.

I think that ZeosLib doesn't use the wince sqlite dll version right...
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

Hi,

it would be very kind explain to us how you have configured lazarus in order to compile Zeos with wince compiler, because lots of people asks for it.

I suppose you donloaded lazarus 0.9.26.2 + lazarus-qt-0.9.23-fpc-2.2.0-20071028-win32.exe

but How to configure lazarus in order to compile with the Wince compiler and give you a hand?
nicolagorlandi
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 18.05.2009, 08:19

Post by nicolagorlandi »

I dowload the lazarus+ 2.2.5 fpc version from lazarus daily snapshot (http://www.hu.freepascal.org/lazarus/).

I download Lazarus and the Win32->Arm setup...

Hope this help...
nicolagorlandi
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 18.05.2009, 08:19

Post by nicolagorlandi »

To install, first install lazarus and then lazarus win32_arm (both in the same directory, for example c:\lazarus)

Once install lazarus, create a new project an then goes to
Project / Compiler Option..
In the first tab select Wince(beta) as widgets type (the combo on the botton) then in the third tab (Code) select as Destination SO (-T) Wince, as Target CPU family (-P) choose arm.

You could try to press the Test button to check if everything is ok.

Confirm the form and press Build...
lukezeoslib
Fresh Boarder
Fresh Boarder
Posts: 16
Joined: 22.02.2009, 17:21

Post by lukezeoslib »

I will pay more attention to this thread, because it is hard to find a free WINCE(WM) local DB file system, especially for Pascal language, But last time I used lazarus few minutes, it built a LARGE SIZE program for win32, it was terrible for me, even if I unchecked the debug msg from the project options.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Ever tried to 'strip' and eventually 'upx' the result? For me this reduces the size of the Lazarus IDE from 117 MB to 2.5 MB.
I admit, it would be nice if fpc or Lazarus would allow to execute this by setting compiler options.

Personally I execute following commands in a batch file after compiling Lazarus:

Code: Select all

fpc\2.2.2\bin\i386-win32\strip --strip-all --discard-all lazarus*.exe
fpc\2.2.2\bin\i386-win32\upx --best lazarus*.exe
It makes loading the IDE very fast and until now I never had problems with the functionality of the program.

Mark
Image
Post Reply