Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:05:24+00:00 2026-06-16T01:05:24+00:00

If an RC file is modified, Delphi will compile it again. If an RC

  • 0

If an RC file is modified, Delphi will compile it again. If an RC file has RCDATA or BITMAP declarations that reference files that have changed, Delphi will not recompile the .RC file to .RES again until I force it to by deleting the .RES file or doing a “touch” (modify file timestamp) on the top level .RC file.

Here’s a sample TEST.RC file:

SAMPLE   RCDATA "File.txt"

When TEST.RC is modified, that will cause a recompilation, when “File.txt” is modified, however Delphi does not recompile the resources, on a “Compile”. I am not willing to just use “Build” because it increases my time from seconds to several minutes.

Has anyone ever gotten Delphi to work properly with .RC text files and dependencies? Granted some people add resources and never change them, but I have started using .RC files for things that I may often change such as binary or text data that is in RCDATA sections in an .RC file.

Note that trying to put a “delete .res” step in pre-build or post-build appears to break the Delphi IDE/compiler. I can sort this out externally when building outside the IDE (always delete certain .res files before I run msbuild), but inside the IDE, Delphi doesn’t give me much of a choice.

Has anyone got a solution? (I’m having this problem in Delphi 2007, but any solution that works with any version of Delphi from 2007 up to XE3 would be welcome.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:05:25+00:00Added an answer on June 16, 2026 at 1:05 am

    This is not exactly a perfect answer since no dependency checking is done by the below sample, however the basic problem of the resource not being rebuilt frequently enough is fixed by Always Rebuilding Every Time, which is Good Enough.

    That in the end is more correct than Delphi’s built in behaviour which varies from (a) not recompiling frequently enough while you build from an {$R foo.res foo.rc} declaration when you use it inside the IDE to the even worse state of (b) not building at all from the commandline if you include a {$R foo.res foo.rc} declaration in your .dpr file.

    So, with all that, here’s a working pre-build step, which does what David suggested I do:

      call $(PROJECTDIR)\SubDir\foo.cmd $(PROJECTDIR)
    

    here’s what my foo.cmd contains:

      cd %1\SubDir
      rc.exe foo.rc
      echo compiled foo RCDATA
    

    For anyone wondering what foo.rc might contain it might look like this:

      SQL_QUERY_1  RCDATA  "SqlDir1\MYSQL.SQL"
    

    ERRATA:

    I have found that {$R foo.res foo.rc} only builds properly in Delphi 2007 from within the IDE. From the commandline MSBUILD, it won’t build. You just get “DCC ERROR 1”
    and the build aborts without a real error message. You may be interested to know that one of the reasons delphi MSBUILD compiles mysteriously abort without any error output in the error log or to stdout, is when RC.exe returns an errorlevel. RC.exe outputs a real error message (Hey Delphi you sent me invalid command line parameters, I’m giving up), and either Delphi DCC32doesn’t forward that along back to you, or it is somehow otherwise gobbled up and not given back to users so they can have enough information to know why their build mysteriously breaks. Nasty little msbuild-dcc32 integration mis-feature, that.

    Instead of {$R subdir\foo.res subdir\foo.rc}, you should have this in your DPR:

      {$R SubDir\foo.res}
    

    That means “link that binary resource and don’t try to recompile, because we did it fer ya already”. All of the above is just by way of making explicit what David suggested in a comment. Hat tip to David.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a filesystemwatcher that will trigger an event when a file is modified.
Let's say I have a file that's Modified in master Modified in a feature
What's the best way to tell my application that the file has been modified
I'm trying to revert a commit made that modified a file that has since
I have a tracked file (an old versioned file) that i modified on master
I have a problem getting file modified time as julian date. My Delphi 2010
I want to parse out each modified file that is reported during FCIV's verification
I'm writing a script that gets the most recently modified file from a unix
I know how to get the user that last modified a file, but does
I've modified my .htaccess file to have the following statement RewriteCond $1 !^index.php$ RewriteRule

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.