# Rodl2code to generate RODLFILE.res from a RODL file that links another?

**URL:** https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497
**Category:** Remoting SDK
**Created:** [June 22, 2023, 6:52pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497 "2023-06-22T18:52:28Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [June 22, 2023, 6:52pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/1 "2023-06-22T18:52:28Z")

</div>

Hello,

I am trying to ensure my `RODLFILE.res` is always current, without having to depend on the IDE compilation to generate it.

I can generate the `RODLFILE.res` easily with the `rodl2code.exe` tool, but I can’t find what I need to do for it to include the linked rodl from my main (the one I pass to `rodl2code`) one. Apparently it just includes that one, even if when generating the res from the IDE it includes both.

I have, basically, a “types” only RODL that is included/referenced from the main RODL, that defines the services and methods.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [June 22, 2023, 7:03pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/2 "2023-06-22T19:03:01Z")

</div>

Hmm. as long as the paths are correct for the include, rodl2code _should_ include this automatically. Can you send me/us a small test case rodl combo (and details how they are located on disk) so we can have a look?

---

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [June 22, 2023, 7:28pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/3 "2023-06-22T19:28:47Z")

</div>

Thanks Marc.

I’ve sent via email two sets of RODL that I have tried here. The paths in the `use` section of the RODL are valid/correct as far as I can see, and both files are on the same folder.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [June 22, 2023, 7:33pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/4 "2023-06-22T19:33:24Z")

</div>

Thanx, let me see.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [June 22, 2023, 7:38pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/5 "2023-06-22T19:38:20Z")

</div>

Reproduced & logged.

Not sure of this is expected (if so, we should add an option), or not. I’ll have to check with the RODA team

---

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [June 22, 2023, 7:39pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/6 "2023-06-22T19:39:56Z")

</div>

Thanks!

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [June 23, 2023, 1:37pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/7 "2023-06-23T13:37:37Z")

</div>

Hi,

this is expected behavior.

`rodl2code` just converts .RODL to .RES as is. it doesn’t merge uses RODLs.

as a temporary workaround, you can merge RODLs manually.

```delphi
r := LoadLibraryFromXml(input);
RODLToXMLFile(r, dest)
r.free;

```

---

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [August 3, 2023, 11:34pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/17 "2023-08-03T23:34:15Z")

</div>

Thanks Evgeny,

Is this option going to be implemented in rodl2code at some point in the future?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [August 4, 2023, 6:44am UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/18 "2023-08-04T06:44:41Z")

</div>

Hi,

yes, it will be implemented.  
currently CodeGen4 (and rodl2code) can only read .RODL but no write it.

as a temporary workaround, you can write simple application that generate .RES from RODL.

code is

```delphi
program rodl2res;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  uROCOMInit,
  System.SysUtils, System.Classes,
  uRODL, uXMLToRODL, uRODLToXML, uROResWriter, uRORes;
const
  ExcludePrivateServices = True;
var
  l_rodl: TRODLLibrary;
  l_bytes: TBytes;
  l_source: TMemoryStream;
  l_dest: TMemoryStream;
begin
  if ParamCount <> 1 then begin
    writeln('usage');
    writeln(' '+ExtractFileName(ParamStr(0))+ ' rodlfile');
    Exit;
  end;
  l_rodl := LoadLibraryFromXml(ParamStr(1));
  l_bytes := RODLToXML(l_rodl, ExcludePrivateServices);
  l_source := TMemoryStream.Create;
  l_dest := TMemoryStream.Create;
  try
    l_source.Write(l_bytes, Length(l_bytes));
    l_source.Position := 0;
    WriteRES(l_source, l_dest, res_RODLFile);
    l_dest.SaveToFile(ChangeFileExt(ParamStr(1),'.RES'));
  finally
    l_source.Free;
    l_dest.Free;
    l_rodl.Free;
  end;
end.

```

---

<div class="post-metadata">

### Author: ![rgomezc](https://talk.remobjects.com/user_avatar/talk.remobjects.com/rgomezc/32/530_2.png) [@rgomezc](https://talk.remobjects.com/u/rgomezc)
#### Post date: [August 4, 2023, 4:01pm UTC](https://talk.remobjects.com/t/rodl2code-to-generate-rodlfile-res-from-a-rodl-file-that-links-another/28497/21 "2023-08-04T16:01:01Z")

</div>

Thanks Evgeny. I’ll wait for the tool to be updated, it’s not too urgent this. I can keep producing the .RES with the IDE tools for the time being.
