* * *

Author Topic: Trying to convert a project from Delphi  (Read 848 times)

ruk1n

  • New member
  • *
  • Posts: 16
Trying to convert a project from Delphi
« on: May 20, 2017, 10:38:39 am »
Hello,

I'm just another Lazarus newbie trying to convert a project from Delphi.
My first trouble comes when I Lazarus told me it aborted the conversion of the .dpr file:

Hint: * Conversion du fichier C:\cygwin64\home\root\Proj01\serverz.dpr *
Hint: Codage modifié de utf8bom en "UTF-8"
Hint: Conversion abandonnée.


How can I help Lazarus to complete the conversion ?

Thanks in advance


JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3076
  • I like bugs.
Re: Trying to convert a project from Delphi
« Reply #1 on: May 20, 2017, 10:46:13 am »
Is there no error message?
Can you copy the whole project here?
Lazarus version?
« Last Edit: May 20, 2017, 10:48:45 am by JuhaManninen »

ruk1n

  • New member
  • *
  • Posts: 16
Re: Trying to convert a project from Delphi
« Reply #2 on: May 20, 2017, 11:11:37 am »
I haven't seen any error messages.
Lazarus version is 1.6.4, fpc 3.02

The whole .dpr file:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectGuid>{a04800b8-b901-4c6b-bf81-4cfe213af470}</ProjectGuid>
    <MainSource>serverz.dpr</MainSource>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
    <DCC_DependencyCheckOutputName>serverz.exe</DCC_DependencyCheckOutputName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <Version>7.0</Version>
    <DCC_DebugInformation>False</DCC_DebugInformation>
    <DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
    <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
    <DCC_Define>RELEASE</DCC_Define>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <Version>7.0</Version>
    <DCC_Define>DEBUG;madExcept</DCC_Define>
    <DCC_MapFile>3</DCC_MapFile>
  </PropertyGroup>
  <ProjectExtensions>
    <Borland.Personality>Delphi.Personality</Borland.Personality>
    <Borland.ProjectType>VCLApplication</Borland.ProjectType>
    <BorlandProject>
<BorlandProject><Delphi.Personality><Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1036</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Source><Source Name="MainSource">serverz.dpr</Source></Source></Delphi.Personality></BorlandProject></BorlandProject>
  </ProjectExtensions>
  <Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
  <ItemGroup>
    <DelphiCompile Include="serverz.dpr">
      <MainSource>MainSource</MainSource>
    </DelphiCompile>
    <DCCReference Include="..\Indy10\Lib\Protocols\IdMessageBuilder.pas" />
    <DCCReference Include="..\TangentPack\Tangent NonVisual\TangentAutorun.pas" />
    <DCCReference Include="BSent.pas">
      <Form>FBoardSent</Form>
    </DCCReference>
    <DCCReference Include="C_Server.pas" />
    <DCCReference Include="Cntd.pas">
      <Form>Form1</Form>
    </DCCReference>
    <DCCReference Include="Cont.pas" />
    <DCCReference Include="DCs.pas" />
    <DCCReference Include="ES.pas">
      <Form>ErrorDisplay</Form>
    </DCCReference>
    <DCCReference Include="IS.pas">
      <Form>Main_Form</Form>
    </DCCReference>
    <DCCReference Include="JB.pas" />
    <DCCReference Include="msg.pas" />
    <DCCReference Include="OF.pas" />
    <DCCReference Include="SD.pas">
      <Form>OKRightDlg</Form>
    </DCCReference>
    <DCCReference Include="TSKs.pas" />
    <DCCReference Include="TRDs.pas">
      <Form>Form2</Form>
    </DCCReference>
    <DCCReference Include="TNs.pas" />
    <DCCReference Include="trsf.pas">
      <Form>OkTransfert</Form>
    </DCCReference>
    <DCCReference Include="UCt.pas">
      <Form>FComment</Form>
    </DCCReference>
    <DCCReference Include="UTs.pas" />
  </ItemGroup>
</Project>

Thaddy

  • Hero Member
  • *****
  • Posts: 4413
Re: Trying to convert a project from Delphi
« Reply #3 on: May 20, 2017, 11:43:23 am »
That is NOT a dpr file.... That's an msbuild project.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

ruk1n

  • New member
  • *
  • Posts: 16
Re: Trying to convert a project from Delphi
« Reply #4 on: May 20, 2017, 11:56:10 am »
It was a .dproj file I renamed to .dpr... 8-)

I suppose I have to create by hand a Lazarus project...

Thanks for your answer

Thaddy

  • Hero Member
  • *****
  • Posts: 4413
Re: Trying to convert a project from Delphi
« Reply #5 on: May 20, 2017, 12:00:35 pm »
It was a .dproj file I renamed to .dpr... 8-)

I suppose I have to create by hand a Lazarus project...

Thanks for your answer

No, you should not have opened the msbuild project, but the main dpr file. There's nothing to rename. There's always a dpr in a Delphi project. And it contains pascal code, not xml.

Ergo, you started with the wrong file. Don't rename anything. Lazarus will create an lpr (lazarus main project file) and an lpi, (its buildscript)
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

howardpc

  • Hero Member
  • *****
  • Posts: 2294
Re: Trying to convert a project from Delphi
« Reply #6 on: May 20, 2017, 12:32:54 pm »
Best to copy the original Delphi project to a new empty directory. As Thaddy says, don't rename anything. Delete everything in the previous directory where you renamed files etc. and remove that directory.

Then you want Tools > Delphi Conversion > Convert Delphi Project to Lazarus Project.
In the Open dialog that appears navigate to find the .dpr file of the Delphi project you want converted. Accept all the defaults offered and Lazarus does a good job of conversion.
Any glitches, come back here, but 9 times out of 10 the converter works better than you might expect, given the complexity of the hurdles it has to overcome in translating Delphi code and .dfms from so many possible Delphi versions. Only if the code is severely Windows-dependent with lots of API calls and the like (or depends on lots of third party components for which the source is unavailable) will the conversion sometimes fail to give you a compilable result that needs tweaking by hand (or rewriting from scratch to be cross-platform).
« Last Edit: May 20, 2017, 12:36:06 pm by howardpc »

ruk1n

  • New member
  • *
  • Posts: 16
Re: Trying to convert a project from Delphi
« Reply #7 on: May 20, 2017, 01:40:18 pm »
One finally send me the missing .dpr file, and Lazarus converted it!
Many thanks for the explanations!

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus