Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-05

porting delphi project code

33 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

waldo kitty

can someone please give me the steps, in simple layman's terms, that are needed to convert a delphi project or application code to Lazarus/FPC? i have never run delphi and have not the first clue other than there is some sort of convertor available... where it is and how to use it are completely unknown to myself...

thank you! ;)

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Howard Page-Clark
to waldo kitty
waldo kitty wrote 6 lines
can someone please give me the steps, in simple layman's terms, that are needed to convert a delphi project or application code to Lazarus/FPC? i have never run delphi and have not the first clue other than there is some sort of convertor available... where it is and how to use it are completely unknown to myself...

Open the Lazarus IDE and you'll see the Tools menu has four conversion menu options relating to Delphi. Looks like you want the second Delphi conversion option:
Convert Delphi project to Lazarus project...
For simple projects the converter works well if you just accept all the defaults the wizard provides.
Your Delphi code is saved unchanged, and the new Lazarus project ends up in a new directory with appropriate new .lpi, .lpr and .lfm files, .pas files adapted to use the LCL and probably substitutions for some Delphi components with their (approximately) equivalent LCL counterparts.

Reply by email

Reinier Olislagers
to waldo kitty: can someone please give me the steps, in simple layman's terms, that are needed to…
waldo kitty wrote 6 lines
can someone please give me the steps, in simple layman's terms, that are needed to convert a delphi project or application code to Lazarus/FPC? i have never run delphi and have not the first clue other than there is some sort of convertor available... where it is and how to use it are completely unknown to myself...

The wiki helps as usual:
http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus

Suggest more people try it ;)

Reply by email

waldo kitty
to Howard Page-Clark: Open the Lazarus IDE and you'll see the Tools menu has four conversion menu options…
Howard Page-Clark wrote 18 lines
On 15/05/2013 19:19, waldo kitty wrote: > > can someone please give me the steps, in simple layman's terms, that are > needed to convert a delphi project or application code to Lazarus/FPC? i > have never run delphi and have not the first clue other than there is > some sort of convertor available... where it is and how to use it are > completely unknown to myself... Open the Lazarus IDE and you'll see the Tools menu has four conversion menu options relating to Delphi. Looks like you want the second Delphi conversion option: Convert Delphi project to Lazarus project... For simple projects the converter works well if you just accept all the defaults the wizard provides. Your Delphi code is saved unchanged, and the new Lazarus project ends up in a new directory with appropriate new .lpi, .lpr and .lfm files, .pas files adapted to use the LCL and probably substitutions for some Delphi components with their (approximately) equivalent LCL counterparts.

thank you, howard... i've just tried this and it seemed to work but i aborted it when it could not find suitable replacements for

StdCtrls
ComCtrls
Buttons
ExtCtrls

i had it search my lazarus tree as well as my FPC 2.6.2 tree... i'm not sure which way to go at this juncture...

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty
waldo kitty wrote 7 lines
thank you, howard... i've just tried this and it seemed to work but i aborted it when it could not find suitable replacements for StdCtrls ComCtrls Buttons ExtCtrls

Those units exist in LCL. They don't need replacements.

Juha

Reply by email

waldo kitty
to Reinier Olislagers: The wiki helps as usual: http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus…
Reinier Olislagers wrote 10 lines
On 15-5-2013 20:19, waldo kitty wrote: > > can someone please give me the steps, in simple layman's terms, that are > needed to convert a delphi project or application code to Lazarus/FPC? i > have never run delphi and have not the first clue other than there is > some sort of convertor available... where it is and how to use it are > completely unknown to myself... The wiki helps as usual: http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus

in this case, it does not... it seems to be out of date, as well... the picture of the "Convert Delphi Settings" dialogue shows four targets but what i have shows only two... mine are

Cross-platform (checked)
Support Delphi (unchecked)
Use the same DFM form file (greyed out)

Suggest more people try it ;)

it is ok for what it is but it doesn't help all the time... my conversion project is not going too well at this point... i followed the above link to the wiki and it helped a little bit but it fell short as it only explains about the options in that one area but nothing else is discussed (eg: what to do when StdCtrls cannot be found)...

so i searched for "delphi stdctrls" and found a section in the FAQ but it, too, falls short... again, possibly out of date??

[quote]
When accessing events of objects, e.g., the onclick event of a button, I get the following error. ERROR unit not found: stdCtrls

Make sure, in the Project -> Project Inspector, that your project depends on the package "LCL" and that you have installed the FPC sources.

Lazarus is the IDE and the visual components library LCL. All other stuff, like IO, Database, FCL and RTL are provided by FPC. The IDE needs the paths to all sources.

The FPC source path can be set via: Environment -> Environment Options -> Files -> FPC source directory
[/quote]

1. i don't have a project yet... i'm trying to convert a delphi project to a lazarus project.

2. about the source path... i believe it is already set correctly but the above "Environment -> Environment Options -> Files -> FPC source directory" does not appear in my lazarus ide that i can find... i have "Tools -> Options -> Environment -> Files -> FPC Source Directory" and it is set to "C:\freepascal\fpc\2.6.0\" where my SVN installation of FPC is installed...

so now what? :confused:

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty

I updated the wiki page, although it was not causing your problems. Your FPC/Lazarus configuration is somehow screwed. Test it first before converting anything.

Juha

waldo kitty wrote 82 lines
On 5/16/2013 02:11, Reinier Olislagers wrote: > On 15-5-2013 20:19, waldo kitty wrote: >> >> can someone please give me the steps, in simple layman's terms, that are >> needed to convert a delphi project or application code to Lazarus/FPC? i >> have never run delphi and have not the first clue other than there is >> some sort of convertor available... where it is and how to use it are >> completely unknown to myself... > > The wiki helps as usual: > http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus in this case, it does not... it seems to be out of date, as well... the picture of the "Convert Delphi Settings" dialogue shows four targets but what i have shows only two... mine are Cross-platform (checked) Support Delphi (unchecked) Use the same DFM form file (greyed out) > Suggest more people try it ;) it is ok for what it is but it doesn't help all the time... my conversion project is not going too well at this point... i followed the above link to the wiki and it helped a little bit but it fell short as it only explains about the options in that one area but nothing else is discussed (eg: what to do when StdCtrls cannot be found)... so i searched for "delphi stdctrls" and found a section in the FAQ but it, too, falls short... again, possibly out of date?? [quote] When accessing events of objects, e.g., the onclick event of a button, I get the following error. ERROR unit not found: stdCtrls Make sure, in the Project -> Project Inspector, that your project depends on the package "LCL" and that you have installed the FPC sources. Lazarus is the IDE and the visual components library LCL. All other stuff, like IO, Database, FCL and RTL are provided by FPC. The IDE needs the paths to all sources. The FPC source path can be set via: Environment -> Environment Options -> Files -> FPC source directory [/quote] 1. i don't have a project yet... i'm trying to convert a delphi project to a lazarus project. 2. about the source path... i believe it is already set correctly but the above "Environment -> Environment Options -> Files -> FPC source directory" does not appear in my lazarus ide that i can find... i have "Tools -> Options -> Environment -> Files -> FPC Source Directory" and it is set to "C:\freepascal\fpc\2.6.0\" where my SVN installation of FPC is installed... so now what? :confused: -- NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

waldo kitty
to Juha Manninen: Those units exist in LCL. They don't need replacements. Juha
Juha Manninen wrote 10 lines
On 5/21/13, waldo kitty wrote: > thank you, howard... i've just tried this and it seemed to work but i > aborted it when it could not find suitable replacements for > > StdCtrls > ComCtrls > Buttons > ExtCtrls Those units exist in LCL. They don't need replacements.

understood but the delphi convertor wanted to replace them... i had it check numerous directories with no luck... finally i took a chance and told it to comment them out... i haven't seen where it did that but it did complete the conversion...

now i have another problem to deal with when i try to build the project, it keeps telling me that it can't find LazLogger... it seems to find the ppu and then wants the sources... i went hunting and found the last compile of them was about a month ago so i closed the project and had lazarus rebuild itself... the lazlogger o and ppu files in laz\components\lazutils\lib\i386-win32 were updated to the correct date and time but the converted delphi project still won't build... the sources from SVN are right there in laz\components\lazutils too :?

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

waldo kitty
to Juha Manninen: I updated the wiki page, although it was not causing your problems. Your FPC/Lazarus…
Juha Manninen wrote
I updated the wiki page, although it was not causing your problems.

thank you...

Your FPC/Lazarus configuration is somehow screwed. Test it first before converting anything.

i don't know how it can be... this is a clean from SVN installation following the wiki page for that...

i misspoke earlier when i said i was using FPC 2.6.2... it is 2.6.0 and lazarus 1.1 from trunk rev: 40489...

as far as i know my config has been correct all this time i've been using it... but i rarely do any GUI programs... mostly i compile a few example ones to make sure that it will compile them... 95% or more of my stuff is all command line tools...

Show quoted text 74 lines
Juha On 5/21/13, waldo kitty wrote: > On 5/16/2013 02:11, Reinier Olislagers wrote: >> On 15-5-2013 20:19, waldo kitty wrote: >>> >>> can someone please give me the steps, in simple layman's terms, that are >>> needed to convert a delphi project or application code to Lazarus/FPC? i >>> have never run delphi and have not the first clue other than there is >>> some sort of convertor available... where it is and how to use it are >>> completely unknown to myself... >> >> The wiki helps as usual: >> http://wiki.lazarus.freepascal.org/Delphi_Converter_in_Lazarus > > in this case, it does not... it seems to be out of date, as well... the > picture > of the "Convert Delphi Settings" dialogue shows four targets but what i have > > shows only two... mine are > > Cross-platform (checked) > Support Delphi (unchecked) > Use the same DFM form file (greyed out) > >> Suggest more people try it ;) > > it is ok for what it is but it doesn't help all the time... my conversion > project is not going too well at this point... i followed the above link to > the > wiki and it helped a little bit but it fell short as it only explains about > the > options in that one area but nothing else is discussed (eg: what to do when > > StdCtrls cannot be found)... > > so i searched for "delphi stdctrls" and found a section in the FAQ but it, > too, > falls short... again, possibly out of date?? > > [quote] > When accessing events of objects, e.g., the onclick event of a button, I get > the > following error. ERROR unit not found: stdCtrls > > Make sure, in the Project -> Project Inspector, that your project depends on > the > package "LCL" and that you have installed the FPC sources. > > Lazarus is the IDE and the visual components library LCL. All other stuff, > like > IO, Database, FCL and RTL are provided by FPC. The IDE needs the paths to > all > sources. > > The FPC source path can be set via: Environment -> Environment Options -> > Files > -> FPC source directory > [/quote] > > 1. i don't have a project yet... i'm trying to convert a delphi project to a > > lazarus project. > > 2. about the source path... i believe it is already set correctly but the > above > "Environment -> Environment Options -> Files -> FPC source directory" does > not > appear in my lazarus ide that i can find... i have "Tools -> Options -> > Environment -> Files -> FPC Source Directory" and it is set to > "C:\freepascal\fpc\2.6.0\" where my SVN installation of FPC is installed... > > so now what? :confused:
NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty

Does Lazarus trunk compile with FPC 2.6.0? Anyway it is not a problem. Try a test GUI app with one button. Do you get the errors then? The converter does not create errors about missing standard units. Something else causes it.

Juha

Reply by email

waldo kitty
to Juha Manninen
Juha Manninen wrote
Does Lazarus trunk compile with FPC 2.6.0?

it has been for me... at least up to the revision i gave previously... i've not updated in a few weeks, though...

Anyway it is not a problem. Try a test GUI app with one button. Do you get the errors then?

i ran the example dialogues code and it worked just fine... i did that before writing my previous posts...

The converter does not create errors about missing standard units. Something else causes it.

i understand that... i just don't know why it couldn't find those units and why telling it to comment them out did not result in them being commented out... yes, i elected to leave the converted files open in the editor and i looked at every one of them specifically for this as well as a need to translate russian language comments to english...

so if this is a path problem, what, exactly, should the base paths be in what files so that i can check this installation and fix them?? i did tell lazarus to rescan the FPC directory using the menu option but that didn't help this problem...

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty

Maybe your project revealed a bug in converter. Maybe LCL dependency is not added because of some other error.
Can you share the project? I could have a can also make sure that converter works for other apps. For example download "CannonBalls" from delphiforfun.com site. It converts without any manual tweaking.

Juha

Reply by email

waldo kitty
to Juha Manninen
Juha Manninen wrote
Maybe your project revealed a bug in converter. Maybe LCL dependency is not added because of some other error.

LCL dependency was added... i see that in the project inspector...

Show quoted text 5 lines
Can you share the project? I could have a will contact you offlist about this... You can also make sure that converter works for other apps. For example download "CannonBalls" from delphiforfun.com site. It converts without any manual tweaking.

i will take a look and see how it goes ;)

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

waldo kitty
to Juha Manninen: Maybe your project revealed a bug in converter. Maybe LCL dependency is not added because…
Juha Manninen wrote
Maybe your project revealed a bug in converter. Maybe LCL dependency is not added because of some other error.

following up on this... thanks Juha! :)

LCL dependency was properly added to the converted project however there was a bug discovered...

[quote="juha"]
Remove Forms.pas from src directory. It is copied from Delphi 7. Codetools parser finds 2 different Forms units and gives an error. The error is valid but the request to comment out standard units is a wrong action. I will see how to give a sensible message instead.
[/quote]

that covers what i've run into so far...

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty
waldo kitty wrote
LCL dependency was properly added to the converted project however there was a bug discovered...

Actually the LCL dependency was not yet added at that point. It was a strange error what the first unit in the project referenced a copied VCL unit.

The package dependency is usually added dynamically when a unit is found in a package.
Now I forced LCL dependency always at the start of conversion. It is more a workaround than a fix but no problem.

waldo kitty, you should use the latest trunk anyway for conversion. It has also other improvements. You can use the FPC release version.

Juha

Reply by email

waldo kitty
to Juha Manninen
Juha Manninen wrote 7 lines
On 5/26/13, waldo kitty wrote: > LCL dependency was properly added to the converted project however there was > a bug discovered... Actually the LCL dependency was not yet added at that point. It was a strange error what the first unit in the project referenced a copied VCL unit.

thanks for the clarification... i had only the end results to go by ;)

The package dependency is usually added dynamically when a unit is found in a package. Now I forced LCL dependency always at the start of conversion. It is more a workaround than a fix but no problem.

as long as it works :P

waldo kitty, you should use the latest trunk anyway for conversion. It has also other improvements. You can use the FPC release version.

yes, i do need to update my lazarus from svn... it has been a few weeks i think... i should also switch from FPC 2.6.0 to 2.6.2 which i think i will do when i make the update... it /should/ be an easy switch in my scripts... just a one character change from '0' to '2' ;)

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

waldo kitty
to Juha Manninen: Actually the LCL dependency was not yet added at that point. It was a strange error what…
Juha Manninen wrote
On 5/26/13, waldo kitty wrote: waldo kitty, you should use the latest trunk anyway for conversion. It has also other improvements. You can use the FPC release version.

today i have upgraded to FPC 2.6.2 release from SVN, updated Lazarus to Lazarus 1.1 r41477 FPC 2.6.2 i386-win32-win32/win64... i compile lazarus in debug mode to get heaptrc results for reporting here (at times)...

i have started fresh with a new copy of the delphi project with that forms.pas file removed (renamed actually) and then followed the same procedure as before...

1. Tools -> Convert Delphi project to Lazarus project
2. selected Cross Platform, Make backup, Keep converted file open all other options are default (auto, auto, auto, enabled, enabled)
3. Unit not found in MClasses.pas - Consts - click "Comment out"
4. Unit not found in MlrForm.pas - XPMan - click "Comment out"
5. conversion complete
6. check MClasses.pas (already open) in editor.
a. Consts is first in uses line at top of file and NOT commented out.
7. check MlrForm.pas (already open) in editor
a. XPMan is last in uses line and NOT commented out.
8. Select converted LPR in editor
9. attempt compile (CTRL-F9)
10. must comment out FastMM4 in xBase as NOT Found.
11. select LPR again and CTRL-F9 again
12. LCLProc gets loaded and the line

       {$IFnDEF WithOldDebugln} LazLogger, {$ENDIF}
     is hilited with the cursor at the beginning of LazLogger
     and error reported is
       ..\..\..\laz\lcl\lclproc.pas(34,28) Fatal: Can't find unit LazLogger used

by LCLProc
13. close converted project with save option.
14. New Project - Application
15. quit Lazarus with clean exit from heaptrc

i've no clue where to look for the problem... i have successfully compiled a blank unmodified new application project with no problems...

either i've found another bug or there is another file in the directory i need to remove/rename :?

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty
waldo kitty wrote
either i've found another bug or there is another file in the directory i need to remove/rename :?

There are bugs yes. I fixed a regression for include filenames handling. Now it does not throw an exception on LngTools unit. It still throws an exception for Jedi units. They have strange syntax in their (include and other) files. Codetools cannot currently handle it.
Please try to get rid of Jedi if you plan to have a cross-platform port.

I did another change. Conversion is done in 2 phases, first analyzing and converting unit files, then converting form files and replacing / adding / removing used units in unit files.
With an exception during the 1. phase, the whole conversion was screwed. Now the 2. phase is done for all units that were converted so far.

Please test.

Reply by email

waldo kitty
to Juha Manninen
Juha Manninen wrote 6 lines
On Sat, Jun 1, 2013 at 2:47 AM, waldo kitty wrote: > either i've found another bug or there is another file in the directory i > need to remove/rename :? There are bugs yes. I fixed a regression for include filenames handling. Now it does not throw an exception on LngTools unit.

hummm... i don't recall that one specifically... i've not gone thru the code too much yet... i didn't plan to until the conversion was successful...

It still throws an exception for Jedi units. They have strange syntax in their (include and other) files. Codetools cannot currently handle it. Please try to get rid of Jedi if you plan to have a cross-platform port.

i'll have to dig to see where that is even used... i still don't know what it even does but i haven't had time to research it either...

Show quoted text 5 lines
I did another change. Conversion is done in 2 phases, first analyzing and converting unit files, then converting form files and replacing / adding / removing used units in unit files. With an exception during the 1. phase, the whole conversion was screwed. Now the 2. phase is done for all units that were converted so far.

ahhh :) i think that might be a better route to go...

Please test.

i shall O:)

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

waldo kitty
to Juha Manninen: There are bugs yes. I fixed a regression for include filenames handling. Now it does not…
Juha Manninen wrote 7 lines
I did another change. Conversion is done in 2 phases, first analyzing and converting unit files, then converting form files and replacing / adding / removing used units in unit files. With an exception during the 1. phase, the whole conversion was screwed. Now the 2. phase is done for all units that were converted so far. Please test.

i copied over my backup directory to start clean the same as before...

this time i renamed the Jedi directory to -Jedi to disable it... or so i though! see below...

MClasses.pas - unit Consts not found - clicked "Comment out" MlrForm.pas - unit XPMan not found - clicked "Comment out"

wow... there's a lot more processing going on now... i see a "second pass"(?) thru the open files...

too smart! found -Jedi directory and tried to use it... then the messages window said that conversion was aborted... i did not copy the messages...

closing Lazarus, i chose to NOT save the project... heaptrc gave me this spittle...

(typing by hand :( each '=====' line marks where i had to hit the [OK] button)

Heap dump by heaptrc unit
8692249 memory blocks allocated : 771969829/806033864 8687936 memory blocks freed : 771802469/805856352 4313 unfreed memory blocks : 167360
True heap size : 34865152
True free heap : 34362736
Should be : 34411608
Call trace for block $0C9E5B10 size 64
$0040EEA8 line 334958 of (Unknown file)
$0040CE51 line 334958 of (Unknown file)
$00A432F9 line 2433 of customcodetool.pas
$00A43374 line 2443 of customcodetool.pas
$00A3D799 line 392 of customcodetool.pas
$00A3D9F9 line 438 of customcodetool.pas
$00A3DAA4 line 444 of customcodetool.pas
$00A509A8 line 4903 of pascalparsertool.pas
Call trace for block $0C5F1C90 size 24
$0040CE51 line 334958 of (Unknown file)
$00A432F9 line 2433 of customcodetool.pas
$00A43374 line 2443 of customcodetool.pas
$00A3D799 line 392 of customcodetool.pas
$00A3D9F9 line 438 of customcodetool.pas
$00A3DAA4 line 444 of customcodetool.pas
$00A509A8 line 4903 of pascalparsertool.pas
$00A46E76 line 690 of pas
=====
$00A46E76 line 69Call trace for block $0C5F5410 size 16 $00A43374 line 2443 of customcodetool.pas
$00A3D799 line 392 of customcodetool.pas
$00A3D9F9 line 438 of customcodetool.pas
$00A3DAA4 line 444 of customcodetool.pas
$00A509A8 line 4903 of pascalparsertool.pas
$00A46E76 line 690 of pascalparsertool.pas
$00CCB8A6 line 532 of ../convertor/usedunits.pas
$008F9CA4 line 541 of ../convertor/convertdelphi.pas Call trace for block $0D5A2D88 size 105
$0040EEA8 line 334958 of (Unknown file)
$0041B57A line 334958 of (Unknown file)
$00A3DA6A line 444 of customcodetool.pas
$00A509A8 line 4903 of pascalparsertool.pas
$00A46E76 line 690 of pascalparsertool.pas
$00CCB8A6 line 532 of ../converter/usedunits.pas
$008F9CA4 line 541 of ../converter/convertdelphi.pas $00900991 line 1581 of ../converter/convertdelphi.pas Call trace for block $0C5F3A90 size 24
$008F9C3E line 534 of ../converter/convertdelphi.pas $00900991 line 1581 of ../converter/convertdelphi.pas $00
=====
$00900668 line 1615 of ../converter/convertdelphi. $008FC49E line 1024 of ../converter/convertdelphi.pas
$008FBF1F line 973 of ../converter/convertdelphi.pas $0046AC54 line 8014 of main.pp
$00770006 line 574 of menuintf.pas
Call trace for block $1459FCC8 size 64
$00CB980B line 744 of ../converter/convertsettings.pas $008F9B12 line 518 of ../converter/convertdelphi.pas $00900991 line 1581 of ../converter/convertdelphi.pas $00900668 line 1615 of ../converter/convertdelphi.pas $008FC49E line 1024 or ../converter/convertdelphi.pas $008FBF1F line 973 of ../converter/convertdelphi.pas $0046AC54 line 8014 of main.pp
$0045A460 line 4460 of main.pp
Call trace for block $0CAEBB58 size 44
$0090096F line 1578 of ../converter/convertdelphi.pas $00900668 line 1615 of ../converter/convertdelphi.pas $008FC49E line 1024 of ../converter/convertdelphi.pas $008FBF1F line 973 of ../converter/convertdelphi.pas $0046AC54 line 8014 of main.pp
$
=====
$0045a460 line 4460 of main.p $00770006 line 574 of menuintf.pas $00774387 line 1649 of menuintf.pas
Call trace for block $1459FD58 size 64
$004EA03C line 547 of lazfileutils.pas
$008FF66C line 1453 of ../converter/convertdelphi.pas $00900638 line 1611 of ../converter/convertdelphi.pas $008FC49E line 1024 or ../converter/convertdelphi.pas $008FBF1F line 973 of ../converter/convertdelphi.pas $0046AC54 line 8014 of main.pp
$0045A460 line 4460 of main.pp
$00770006 line 574 of menuintf.pas
Call trace for block $144D0D08 size 32
$00903868 line 497 of ../converter/convcodetool.pas $00904227 line 761 of ../converter/convcodetool.pas $00902B37 line 221 of ../converter/convcodetool.pas $008FA2EF line 658 of ../converter/convertdelphi.pas $009009C2 line 1585 of ../converter/convertdelphi.pas $00900668 line 1615 of ../converter/convertdelphi.pas $008FC49E line 1024 of ../converter/convertdelphi.pas $008FBF1F line 973 of ../converter/convertdelphi.pas Call trace fo
=====

that's enough of that... i quit counting after 300 more [OK] clicks... i'm glad i wasn't trying to type all of that in! i finally used my task manager to kill it after an hour+ of trying to click through it :(

looking back above... 4000+ unfreed blocks with two or maybe three in each heaptrc popup?? no effing wonder it was taking so long to get thru it :(

that heaptrc window really needs to be something other than successive boxes that you can't copy from and can only click your way thru to get to the end... i'd offer a patch if i knew what to do where but i don't so i can't... i'm thinking maybe a memo box with all of the output so that it can all be easily copied and pasted... none if it even shows up in my specified --debug-log=somefile :( :( :(

PS: sorry for the frustration... it is not your fault that heaptrc acts like that...

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty
waldo kitty wrote
too smart! found -Jedi directory and tried to use it... then the messages window

Yes, the converter is smart. It finds files automatically from the project's sibling directories (= its parent's children). Libraries are often places there, like this Jedi now.
Files are scanned in a background thread while the settings dialog is shown.

that heaptrc window really needs to be something other than successive boxes

It is already implemented when compiling Lazarus with HEAPTRC_WINDOW define + using FPC trunk. See issue :
http://bugs.freepascal.org/view.php?id=19837

Forget the heaptracer now when converting a nasty project. When exception comes, things go heyway and it is difficult to clean everything.

Juha

Reply by email

Juha Manninen
to Juha Manninen

I think I got rid of the memory leaks in r41487.

The project under conversion is Taurus FTN mailer, found in SourceForge. No secret there, it is a public repository. There is another unit having the same name with an LCL unit, namely FileUtil. It must be deleted, too, or the compilation breaks. The converter could do something for such files, either delete or rename them.

At some point the code will require heavy manual modifications. The automatic conversion is not enough.

This is a good test case for automatic conversion because of the exceptions raised in codetools. Actually many Delphi projects do that. The converter has worked well when the parsing goes fine but in case of error it stopped working completely.
Now it is already better in this respect.

Juha

Reply by email

Juha Manninen
to Mattias Gaertner
Mattias Gaertner wrote
What syntax gives the error?

Codetools is not to blame here. The error comes because the authors wanted compilation to break if a supported Delphi version is not used. In this case it happens with Jedi libs but I have seen the same idea used in other libs, too.
File jvcl.inc is included in most source files. It has tests :

{$IFDEF DELPHI5}
 {$I jvcld5.inc}
 {$DEFINE JVCL_CONFIGURED}
{$ENDIF DELPIH5}
{$IFDEF DELPHI6}
 {$I jvcld6.inc}
 {$DEFINE JVCL_CONFIGURED}
{$ENDIF DELPIH6}

... and so on for every Delphi and C++Builder version. Then :

{$IFNDEF JVCL_CONFIGURED}
 {$IFDEF SUPPORTS_COMPILETIME_MESSAGES}
  {$MESSAGE FATAL 'Your Delphi/BCB version is not supported by this
JVCL version!'}
 {$ELSE}
  'Your Delphi/BCB version is not supported by this JVCL version!'
 {$ENDIF SUPPORTS_COMPILETIME_MESSAGES}
{$ENDIF !JVCL_CONFIGURED}

The {$ELSE} part is correctly triggered and throws an exception.

There is no way to convert Jedi libs for Lazarus. The converter only should stop as gracefully as possible. I think it is rather good now because it clearly tells where the conversion failed and now it properly converts every file suggesfully parsed before the error.

Still, this is a PITA for the automatic conversion because it happens with most non-trivial projects.

Sometimes codetools has thrown exceptions because of unusual code which is still legal in Delphi. There was the old issue #16061 about a strange use of {$IF...
I have not seen similar things recently, maybe codetools is so good now.

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Show quoted text 36 lines
Juha Manninen hat am 2. Juni 2013 um 13:32 geschrieben: [...] File jvcl.inc is included in most source files. It has tests : {$IFDEF DELPHI5} {$I jvcld5.inc} {$DEFINE JVCL_CONFIGURED} {$ENDIF DELPIH5} {$IFDEF DELPHI6} {$I jvcld6.inc} {$DEFINE JVCL_CONFIGURED} {$ENDIF DELPIH6} ... and so on for every Delphi and C++Builder version. Then : {$IFNDEF JVCL_CONFIGURED} {$IFDEF SUPPORTS_COMPILETIME_MESSAGES} {$MESSAGE FATAL 'Your Delphi/BCB version is not supported by this JVCL version!'} {$ELSE} 'Your Delphi/BCB version is not supported by this JVCL version!' {$ENDIF SUPPORTS_COMPILETIME_MESSAGES} {$ENDIF !JVCL_CONFIGURED} The {$ELSE} part is correctly triggered and throws an exception. There is no way to convert Jedi libs for Lazarus. The converter only should stop as gracefully as possible. I think it is rather good now because it clearly tells where the conversion failed and now it properly converts every file suggesfully parsed before the error. Still, this is a PITA for the automatic conversion because it happens with most non-trivial projects.

Maybe optionally add a -dDelphi7?

Sometimes codetools has thrown exceptions because of unusual code which is still legal in Delphi. There was the old issue #16061 about a strange use of {$IF... I have not seen similar things recently, maybe codetools is so good now.

codetools now recognizes the "declared" call, but it simply results to true.

Mattias

Reply by email

waldo kitty
to Juha Manninen: Yes, the converter is smart. It finds files automatically from the project's sibling…
Juha Manninen wrote 8 lines
On 6/2/13, waldo kitty wrote: > too smart! found -Jedi directory and tried to use it... then the messages > window Yes, the converter is smart. It finds files automatically from the project's sibling directories (= its parent's children). Libraries are often places there, like this Jedi now. Files are scanned in a background thread while the settings dialog is shown.

ok... i'll remove it from the directory tree and try again... i wasn't aware that it would go to that depth...

Show quoted text 5 lines
> that heaptrc window really needs to be something other than successive boxes It is already implemented when compiling Lazarus with HEAPTRC_WINDOW define + using FPC trunk. See issue : http://bugs.freepascal.org/view.php?id=19837

i'll take a look at this... i've always compiled lazarus in debug mode... i guess i'll have to also add FPC-trunk to my setup...

Forget the heaptracer now when converting a nasty project. When exception comes, things go heyway and it is difficult to clean everything.

i'm sure... but i can't tell if it is a bug in lazarus or if it is something triggered by an abort in the conversion... i got rid of anchordocking because of the heaptrc bugs that would popup at times and i was wanting to see if that was causing another problem but i don't recall now what that problem was :?

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty
waldo kitty wrote
i'll take a look at this... i've always compiled lazarus in debug mode... i guess i'll have to also add FPC-trunk to my setup...

Compiling FPC trunk is different from any Lazarus compilation modes. You must build and install FPC trunk separately. It is a little more difficult than building Lazarus trunk because you must edit fpc.cfg, but not very difficult.

i'm sure... but i can't tell if it is a bug in lazarus or if it is something triggered by an abort in the conversion...

It was a bug in Lazarus converter triggered by an exception during conversion, but it is fixed now. See my other mails.

Juha

Reply by email

waldo kitty
to Juha Manninen: Yes, the converter is smart. It finds files automatically from the project's sibling…
Juha Manninen wrote 8 lines
On 6/2/13, waldo kitty wrote: > too smart! found -Jedi directory and tried to use it... then the messages > window Yes, the converter is smart. It finds files automatically from the project's sibling directories (= its parent's children). Libraries are often places there, like this Jedi now. Files are scanned in a background thread while the settings dialog is shown.

i wonder, now that i know that jedi is just a RTL/VCL enhancement library for delphi, how much of it is really needed when using FPC and Lazarus?

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted.

Reply by email

Juha Manninen
to waldo kitty
waldo kitty wrote
i wonder, now that i know that jedi is just a RTL/VCL enhancement library for delphi, how much of it is really needed when using FPC and Lazarus?

None of it is really needed. I believe you can get rid of it quite easily. Most Jedi enhanced components can be replaced with LCL components. Some may require another external library. There are quite many libraries available already supporting Lazarus.

Juha

Reply by email

waldo kitty
to Juha Manninen: Compiling FPC trunk is different from any Lazarus compilation modes. You must build and…
Juha Manninen wrote 8 lines
On 6/2/13, waldo kitty wrote: > i'll take a look at this... i've always compiled lazarus in debug mode... i > guess i'll have to also add FPC-trunk to my setup... Compiling FPC trunk is different from any Lazarus compilation modes. You must build and install FPC trunk separately. It is a little more difficult than building Lazarus trunk because you must edit fpc.cfg, but not very difficult.

currently i use the attached script to compile FPC... i developed it from the wiki page methods... in this case, i will simply call it as

makefpc.bat trunk

i'm going to modify it slightly so that i can also specify which ppc386.exe file to use for the bootstrapping... i'm naming them as

05/21/2012 15:52 2,042,368 ppc386-2.6.0.exe 05/31/2013 15:02 2,051,072 ppc386-2.6.2.exe 05/31/2013 15:02 2,051,072 ppc386.exe

so my script would effectively add -%2 to the ppc386 portion of the PP= parameter of the make line IF %2 is not empty and exists in the directory ;)

i'm not sure what you mean by needing to edit fpc.cfg, though... i do use $FPCVERSION in my generated fpc.cfg (see attached script) but that won't work for this particular trunk install so i'll be leaving those 14 lines with the specific version directory number as 'trunk' in this install...

i do not have user specific fpc.cfg config files at this time...

Show quoted text 5 lines
> i'm sure... but i can't tell if it is a bug in lazarus or if it is something > triggered by an abort in the conversion... It was a bug in Lazarus converter triggered by an exception during conversion, but it is fixed now. See my other mails.

i did see that... i'm glad that i did go ahead and report what i did :)

thank you for your hard work and responses :)

NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless private contact is specifically requested and granted. -------------- next part -------------- @echo off cls rem set our root directory first set myRoot=c:\freepascal if not "%myFPCver%" == "" goto FPCverdone rem now check that we entered a FPC version number if "%1" == "" goto error1 rem set the FPC version number we are compiling echo set myFPCver=%1 set myFPCver=%1 :FPCverdone if not "%myFPCpath%" == "" goto FPCpathdone rem build our path to that version's sources echo set myFPCpath=%myRoot%\fpc\%myFPCver% set myFPCpath=%myRoot%\fpc\%myFPCver% :FPCpathdone rem check that the path exists if not exist %myFPCpath%\nul goto error2 echo directory %myFPCpath% exists... if not "%myFPCbinutils%" == "" goto FPCbinudone rem set our buildutils directory echo set myFPCbinutils=%myRoot%\binutils set myFPCbinutils=%myRoot%\binutils :FPCbinudone if "%myFPCpathset%" == "TRUE" goto pathok echo setting the path... set PATH=%myFPCbinutils%\i386-win32;%myFPCpath%\bin\i386-win32;%PATH% set myFPCpathset=TRUE :pathok rem check if the FPC examples directory exists... if yes, delete it... if not exist %myFPCpath%\examples goto exampdone echo ren %myFPCpath%\examples examps ren %myFPCpath%\examples examps rem rd /s /q %myFPCpath%\examples :exampdone rem now let's go and compile this version of FPC echo. echo compiling FPC %myFPCver%... echo. cd /d %myFPCpath% echo make clean all install INSTALL_PREFIX=%myFPCpath% PP=%myFPCbinutils%\ppc386.exe DATA2INC=%myFPCpath%\utils\data2inc.exe make clean all install INSTALL_PREFIX=%myFPCpath% PP=%myFPCbinutils%\ppc386.exe DATA2INC=%myFPCpath%\utils\data2inc.exe rem now let's create a fpc.cfg if needed if exist %myFPCpath%\bin\i386-win32\fpc.cfg goto end rem create fpc.cfg because it does not exist echo creating fpc.cfg... cd /d %myFPCpath%\bin\i386-win32 echo fpcmkcfg -d basepath=%myFPCpath% -o .\fpc.cfg fpcmkcfg -d basepath=%myFPCpath% -o .\fpc.cfg goto end :error1 echo. echo what version of FPC are we compiling? echo. goto end :error2 echo. echo the directory for FPC %myFPCver% does not exist! please verify and try again... echo. set myFPCver= set myFPCpath= goto end :end cd /d %myRoot%

Reply by email

Mattias Gaertner
to Marco van de Voort
Show quoted text 7 lines
On Sun, Jun 02, 2013 at 02:04:57PM +0200, Mattias Gaertner wrote: > > with most non-trivial projects. > > Maybe optionally add a -dDelphi7? The delphi7 is no real delphi compiler define. They are mapped from ver<x> to that.

-dVer150

Mattias

Reply by email