Hi,
Although I'm a Lazarus beginner, I hope the following can be of use for others who want to convert code and for the improvement of the converter in Lazarus. After having converted my Delphi 4 project with Lazarus 0.9.28.2 beta, Lazarus could build a working executable, but an error message about duplicate resource would show up when I ran my .exe file. The text below, which I found on http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Converting_Delphi_p rojects.2Fforms.2Funits_to_Lazarus, was helpful to solve the problem. I manually edited the converted files according to the parts highlighted with yellow below (hope that the yellow will be visible to all readers) and deleted one of the two lines with {$i unitname.lrs} near the end of the .pas file. Then I could build again and now my new .exe file runs without the error message. In the beginning, it was also a bit confusing that I could not see the unit and form of the converted project, but had to click View. Sven Another method to convert a Delphi or Kylix project to Lazarus * Rename or copy all .dfm or .xfm files to .lfm (Early Delphi versions do not produce a text-based .dfm file. The convert utility, if present in the \bin folder can be used to covert the .dfm first)) * Rename or copy .dpr file to .lpr * Make necessary changes to .lpr file: 1. Add {$mode delphi}{$H+} or {$mode objfpc}{H+} directives 2. Add 'Interfaces' to uses clause 3. Comment out or delete {$R *.res} or directive * Make necessary changes to all .pas unit files: 1. Add {$mode delphi}{$H+} or {$mode objfpc}{H+} directives 2. Add 'LResources', and if the form has buttons, add 'Buttons' to uses clause 3. Comment out or delete {$R *.dfm} or {$R *.xfm} directive 4. Add 'Initialization' section at the end of each unit file, and add {$I unitname.lrs} directive in it * Select Project->New Project from file * Select the .lpr file * At 'Create a new project' window, choose 'Application' * Build project and make further necessary corrections to get proper compilation, at this point the .lpi file is generated automaticaly. You may also get 'Error reading Form' messages, click on 'Continue Loading' if you do. * Save all, and you have a Lazarus project :-)
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
