zedalaye / fbclone

A wonderful tool to take care of your Firebird databases
33 stars 19 forks source link

lazarus support #11

Open mariuz opened 8 years ago

mariuz commented 8 years ago

I have installed uib in lazarus 1.4.2 https://github.com/hgourvest/uib but i have an error at this line in fbclone.lpr

Generics.Collections,

Hint: Error="Problems when trying to find all units from project file /home/mariuz/work/fbclone/fbclone.dpr" Codetools, Errors: 1 fbclone.lpr(24,10) Error: expected ;, but end of file found

and found some related git repo http://stackoverflow.com/questions/15774991/is-there-a-dictionary-object-for-freepascal

jk987 commented 6 years ago

@mariuz If you mean this one: https://github.com/dathox/generics.collections then I've found the same and it seems to work.

I also tried to build fbclone in Lazarus (in my case 1.6.4, FPC 3.0.2) and I had a problem in fbclone.cloner.pas with too few arguments in SQLDump := TStringStream.Create; and SQLDump.SaveToFile(DumpFile); missing in FPC. I used some conversion from TStringStream into TStrings and called TStrings.SaveToFile().

It seemed to be working so then I tried to compile fbclone in linux (some Debian) in command line, no Lazarus, just FreePascal only. :)

In linux I had to comment out all occurences of uses Windows. In some units I had to add {$IFDEF FPC} {$MODE DELPHI} {$ENDIF} (described here: http://lists.freepascal.org/fpc-pascal/2008-February/016682.html http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Selecting_the_right_compiler_mode). Somewhere (fbclone.database.pas?) I had a problem with GetEnvironmentVariable but it could be easily fixed.

And it also seems to work but I will have to test bit more. :)