Forum > General

how to force lazarus make project with text DFM, or LFM ?

(1/2) > >>

alexraynepe196:
Hallow! i've imported design-time package from delphi, and try install it in lazarus 2.0.10 with fpc 3.2.0 on win8

when package converting, i marks `Use the same DFM form file`. And now i have generated binary-DFM on package build.

When i try rebuild lazarus with it, have fails:
```
Error: No known file format detected for file 'D:\projects\pascal\TurboPack\systools.hggit\packages\lazarus\lib\x86_64-win64\StAbout0.DFM'
lazarus.pp(165,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates.
```

i guess, FCP wants text-DFM, or even LFM. How can i force my package to generate text-DFM ?

Bart:
Uncheck `Use the same DFM form file` maybe?

Bart

marcov:
Afaik Lazarus can't generate binary DFM. So probably the Delphi project had some open DFMs.

wp:
You can convert a binary dfm to text format by calling menu "Tools" > "Delphi Conversion" > "Convert binary dfm to text lfm + Check Syntax". As the menu caption says this will create a text lfm file, but you can rename it back to dfm.

But normally it is a bad idea to use the same dfm file in both Delphi and Lazarus because each one of them introduces different properties into their file so that the other will not be able to read it without interrupting your workflow.

What you can do is to replace the {$R *.dfm} by

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$IFDEF FPC}  {$R *.lfm}{$ELSE}  {$R *.dfm}{$ENDIF}This way both Delphi and Lazarus use their own form files.

The disadvantage is that you must keep two files up-to-date this way.

JuhaManninen:

--- Quote from: alexraynepe196 on November 20, 2021, 01:17:09 pm ---when package converting, i marks `Use the same DFM form file`. And now i have generated binary-DFM on package build.
...
How can i force my package to generate text-DFM ?

--- End quote ---
As wp answered, LFM is recommended.
The Delphi converter converts a binary DFM to a text LFM automatically. Maybe a binary DFM is used as-is without conversion. It is such a rare use case that I have not tested it.
Actually binary DFMs are very rare nowadays. They were used only in old Delphi versions. I don't remember exactly when they switched to text format.

Navigation

[0] Message Index

[#] Next page

Go to full version