I got a question today how to migrate an old Kylix project to Delphi 2007 and here is what I answered.
None of our current products support the CLX-framework any more for legal reasons (CodeGear does not have a license from Trolltech on Qt library).
It is possible to manually convert a Kylix project to an ordinary Delphi project very easily, though.
Here is a simplified description of the approach:
- You need to rename the units in the uses clause in all pas-files. Usually you only need to remove the Q infront of the unit name.
- For forms you need to change the extension of the xfm file to dfm. Change the $R directive in the pas-file to include the dfm file instead.
- Properties should be 99% compatible with current version. Open each converted form in Delphi to verify this. If there is any problem, click ignore and make a note so you can investigate if it demands any adjustments.
If you have more tips and trix, drop a comment.
-
- Replace all system color constants in the xfm/dfm files clButton => clBtnFace, …
- Replace all fbsNone, fbsSingle, fbsSizeable, fbsDialog, fbsToolWindow, fbsSizeToolWin to their bs* equivalent in the xfm/dfm files in an external text editor (otherwise the linker won’t be able to link the dfm after you have opened and saved it in the IDE) -
It would also be a great gesture if Codegear would acknowledge that a very large portion of individual Kylix projects for multiplatforms can be preserved by using Freepascal/lazarus. Especially for those projects that demand cross platform native code.
Another thing is that mono and .net go together quite well. So, there is a migration path for Kylix, be it a bit more difficult. (Taking the stpes mentioned above and then migrating it to .net and mono)
-
Andreas: Thank you for your tips!
Thaddy: Yes, I agree that other compilers have their place too, especially for cross platform projects but Delphi is so much more that just an compiler.
I must quote Marco Cantù and say “Delphi is the VCL” (http://blog.marcocantu.com/blog/delphi_is_vcl.html).CLX was a great move to make a VCL clone that does not depend on the Win32 API but instead on the Qt library that exists for more platforms.
Migrating a project that uses CLX to VCL is probably manageable and you could probably succeed to make it VCL.NET compatible too so you can run it in CLR. But VCL.NET is still depending on the Win32 API (like WinForm does too) and even if you could get it to run under Mono you would either have to emulate Win32 on the other platform or create a VCL clone (like CLX) that calls another API.
I’m not an expert on Mono but I think the idea is great to have a platform independent managed runtime environment but reimplementing clones of Microsoft’s class libraries and always playing catch up might not be a good idea.
-
Well: A lot of my vcl.net code actually will run on mono. (With some tweaking) and the guy who tought me the tricks works at Codegear….
I agree with you and Marco that Delphi IS the VCL, be it .net or native, to some extend, but it is also a heck of a compiler. I tend to separate compilers. languages and frameworks. Otherwise I get confused
And the new released BDS version is rather a positive experience.
But I knew that.You should try some mono! That way you’ll be able to judge for yourself that Xplatform is a viable Delphi.net option.

![Fredrik Haglund [Photo by: Kristina Sahlén]](http://blog.fredrikhaglund.se/wp-content/uploads/2010/03/fredrik200.jpg)

4 comments
Comments feed for this article
Trackback link: http://blog.fredrikhaglund.se/blog/2007/09/06/migrate-an-old-kylix-project-to-delphi-2007/trackback/