Abstract: C++Builder 6 Professional project containing a .RC file does not produce final output
C++Builder 6 Professional project containing a .RC file does not produce final output
I am using C++Builder 6 Professional.� When my project contains a .RC file, no final output is generated even though there are no compiler or linker errors.� What is the problem?
The issue is�that when your project contains a .RC file, the Professional edition incorrectly assigns it a CONTAINERID of "RC" rather than "RCCompiler" in the project file.� This will lead to the�behavior you're seeing.� The easiest way to work around this would be to open the .BPR file in a text editor�and manually change the "RC" reference to "RCCompiler" instead.� So, consider the following in the .BPR file:
�--------------------<FILE FILENAME="CmnCtrls.rc" FORMNAME="" UNITNAME="CmnCtrls" CONTAINERID="RC" DESIGNCLASS="" LOCALCOMMAND=""/>-------------------
�That is incorrect and will not build.� The below is correct and should build without problems:
�-------------------<FILE FILENAME="CmnCtrls.rc" FORMNAME="" UNITNAME="CmnCtrls" CONTAINERID="RCCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>-------------------
�Another way to get around this is to use extensions other than .RC for your resource files, and tell C++Builder that you're doing so.� To do this, open C++Builder, go to Tools | Build Tools..., then select RCCompiler and hit Edit.� The Default Extensions field should currently be set to "*.rc".� Change it to something else, for instance ".rcx".� Then hit OK to save your changes.� Now, you just need to make sure your resource files have an extension of .RCX, and C++Builder will no longer have any problems with them.� You do not need to manually edit the .BPR file if you go this route.
Finally,�it should be noted that this problem only�occurs when�doing a Project | Build.� It doesn't happen with a Project | Make.� So, even if you opt to change none of the above,�the�product should�still work properly if you do a Project | Make.� The keyboard shortcut for that is Ctrl+F9.� Of course, there will be times when you want to force a rebuild of the entire project.� In those instances, you would need to first delete all of the intermediate files (for instance .OBJ, .TDS, etc.) before making the project -- this is the main drawback to this approach.� This might be simplified through the use of something like a batch file.
***** SUMMARY *****In short, the problem is that the CONTAINERID for your resource file in the project file is "RC" when it should actually be "RCCompiler".� The easiest way to get around this is to open the project file in Notepad and manually make the change.� Alternatively, the other two workarounds would also suffice.
Author:� Yu-Chen Hsueh