Bug, and fix, for zeoslib(trunk) with FPC/Lazarus in Linux

Forum related to version 6.1.5 of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Almindor
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 26.06.2007, 16:30

Bug, and fix, for zeoslib(trunk) with FPC/Lazarus in Linux

Post by Almindor »

I tried zeoslib from trunk on Linux (32bits, ubuntu) with FPC 2.1.5 and Lazarus/trunk. Everything went fine up until ZAbstractRODataset.pas

It seems that an odd define/ifdef caused a wrong number of elements problem in procedure TZAbstractRODataset.CheckFieldCompatibility(Field: TField;FieldDef: TFieldDef) concretly:

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 VER2_1_3}, ftString, ftBlob{$ENDIF});

I fixed the problem by removing the {$IFDEF VER2_1_3} which seems ISN'T defined for FPC 2.1.5 (or 2.1.4) and thus causes a compiler error (because TFieldType still has the original number of elements). It seems to have worked. You can detect fpc version properly by combination of major and minor defines. NOTE: I got zeoslib sources from svn://firmos.at/zeos as per Lazarus wiki...
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

That's the good place to get it. Only... the patch to correct this is not yet in trunk version. Check testing branch of this repository. I think there it's OK now.

Mark
Post Reply