Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have Delphi automatically compile RC files?

I thought Delphi would automatically compile resource files when I add them to my program, like

{$R 'resource.rc'}

but the linker returns an error message Error reading file "D:\resource.rc". When I look into project options, however, brcc32.exe is explicitly listed as resource compiler to use:

enter image description here

I know I can invoke the resource compiler from the CLI, but I'd prefer to have resources compiled automatically. How can I do this? I'm using Delphi XE8.

like image 868
Joris Groosman Avatar asked Oct 12 '25 19:10

Joris Groosman


2 Answers

You need to add the resources to the project using the Resources and Images item on the Project menu.

like image 180
David Heffernan Avatar answered Oct 15 '25 10:10

David Heffernan


@Joris Grootman I know I'm VERY late to the party, but as another alternative you could set up a "pre-build" event in Delphi (Project Options | Build events | Pre-build events | Commands) to run the resource compiler command before the project builds, and since it's just a quick process you should not notice it slowing down the Delphi build.

like image 39
Donald Klopper Avatar answered Oct 15 '25 10:10

Donald Klopper