Page 1 of 2

problem with zeosdbo-6.6.4 on winCE

Posted: 21.04.2009, 07:44
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.

Posted: 21.04.2009, 09:02
by seawolf
Probably because Zeos does not support WinCE, just Win32

Posted: 22.04.2009, 02:26
by dolang
zeosdbo-6.6.4 support winCE.

Posted: 22.04.2009, 12:43
by zippo
Are you sure? Can you provide a citation?

Posted: 23.04.2009, 06:57
by dolang
what citation do I provide?

Posted: 23.04.2009, 09:25
by zippo
That zeosdbo-6.6.4 supports winCE. I never heard about it, but I'm very interested if it works.

Posted: 24.04.2009, 04:04
by dolang
I see the examples of zeosdbo-6.6.3 develope CE programe.

Posted: 29.04.2009, 07:43
by dolang
use lazarus and zeosdbo can develope CE programe.

Posted: 03.05.2009, 23:42
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

Posted: 18.05.2009, 09:24
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...

Posted: 18.05.2009, 22:23
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?

Posted: 20.05.2009, 11:03
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...

Posted: 22.05.2009, 09:40
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...

Posted: 25.05.2009, 04:55
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.

Posted: 25.05.2009, 08:02
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