Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

resource.h and unused constants

gelarimer
Beginner
1,657 Views

Due to program mods over a period of time, the resorce.h file and resource.fd files have accumulatedconstants that are no longer used. Thought if the resource.h file was renamed Oldresource.h thefile would automatically be rebuilt, butinstead got error mesg whenVisual Studio 2003 loaded. Is there an easy method torebuild the resource.h file or is manual editing the only option? Thanks for any info.

0 Kudos
11 Replies
jimdempseyatthecove
Honored Contributor III
1,657 Views

When you renamed resource.h you then had no file named resource.h. VS doesn't like that. Instead, creat an empty file of the name resource.h. If that doesn't work, copy your old file to name resource.h then remove all the equates relating to all control variables.

I ran into that very same problem a few years ago myself.

Jim Dempsey

0 Kudos
gelarimer
Beginner
1,657 Views
Thanks Jim, I will give it a try.
0 Kudos
gelarimer
Beginner
1,657 Views

Jim, I tried both ways you suggested, but neither worked.Empty resource.h file resultedinMicrosoft Visual C++ generated resource script file error (script file hasINCLUDE resource.h atthe beginning) when VS loads. Error occurs when 1st reference to value that should be in the resource.h file is encountered.

Ifequates deletedand theresource.h file contained comments only,then VS would load without an error, but as soon as I tried to compile resource.h an error would occur in the MS generated script file.

Also the resource.fd file was deleted during one of the tries to recreate resource.h, but was able to recreate from backup.

Any comments would be appreciated.

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,657 Views
You do need the resource.h, and yes, the manual cleanup is the best way to go. However, you have a helper in the Visual Studio: Open the .rc file, right-click on the tree-view's root, and select "Resource symbols". You'll get the dialog with the list containing all symbols and indication whether they're in use, along with "delete" button.

As for "resource.fd", it is semi-automatically "translated" from resource.h by Intel-provided tool called deftofd. The "semi-automation" is achieved by a custom build rule on the resource.h property sheet. The build rule is created if you create the project from File/New/Project or if you converted it from CVF project; otherwise, you have to add it manually, for all configurations. The build rule is universal and it reads:
Command line: deftofd "$(InputPath)" "$(InputDir)$(InputName).fd"
Description:  Generating Fortran include file...
Outputs:      $(InputDir)$(InputName).fd

It possibly got lost during your cleanup attempts; basically, you don't need the backup of resource.fd.

0 Kudos
gelarimer
Beginner
1,657 Views

Thank you JugoslavDujic.

Backed up resource.h and resource.fd then deleted unused values from theresource.h as yousuggested with the aid of the V.S. Symbol Dialog box. ThenI manually deleted the same values fromthe resource.fd file.Worked very well.

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,657 Views
Actually, you didn't have to edit resource.fd -- it should have been automatically re-generated by deftofd. Instead, ensure that the said build rule is present (right-click on resource.h -> Properties) so that they remain in sync in the future.
0 Kudos
gelarimer
Beginner
1,657 Views

Starting to understand. Command line was not present so will try to add. Do appreciate the information,thank you.

0 Kudos
gelarimer
Beginner
1,657 Views

Tried to add the custom build rule for deftofd but do not understand how to do it. Iam usingVS C++.Net 2003 andIVF9.1.

Looked at V.S. Help for Specifying Custom Build Steps (or Rules) and it discusses the Command Line:, Description:, and Outputs: as noted above, but I didnot find the Custom Build Step folderdiscussed in V.S. Help.

The Properties Page for resource.h has only 3 tabs: Build, General, and Command Line. TheCommand Line tab looks the most promising, but there are no entries for Description: (whichapparently is posted in the output windowduring the build process) or Outputs:

Any help would be appreciated.

0 Kudos
gelarimer
Beginner
1,657 Views

Figured it out! I was right clicking on wrong Solution Explorer item (hard to do, but I managed to do it), once I right clicked on resource.h the dialog box with Command Line:, Discription:, and Outputs poped up. Very easy to do. Thanks again.

0 Kudos
Steven_L_Intel1
Employee
1,657 Views
This is also described in the Intel Fortran documentation under Building Applications > Using Windows Features > Using Dialogs for Application Control > Using the Resource Editor > Designing a Dialog Overview
0 Kudos
gelarimer
Beginner
1,657 Views

Thanks Steve for the pointer to the IVF documentation.

0 Kudos
Reply