Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28757 Discussions

Classic Fortran Windows Project in VS2019 won't recognize resource file

CHobbs1
New Contributor I
2,584 Views

All;

I have set up a classic fortran project in VS2019 after installing the one API HPC software.  The test hello, world project compiles and runs for a command line project, but setting up a classic fortran windows project in VS2019 only compiles the fortran code and runs to show a window with the right graphics in it.  There is no menu on the window because the resource file (*.rc) does not compile and link.  

The VS2019 shows the icon of the rc file as blank in the Resource Files folder.  So, I don't think it recognizes it.  Any idea why that might be?

These files work on the command line.  This is a VS2019/1 API - Classic Fortran question.

Any thoughts appreciated.  Thank you.

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
2,515 Views

Click on the Windows Start button and type regedit - when the Registry Editor shows up in the list, click to open it.

Expand HKEY_CLASSES_ROOT and click on .rc (you'll have to scroll down a lot.) Is the Content Type text/plain? I have seen issues where installing other tools changes this to something else, and VS won't recognize it.

What usually fixes this is to delete the .rc entry (click on .rc and press Delete), then run a "repair" on Visual Studio.

 
 

View solution in original post

0 Kudos
9 Replies
Steve_Lionel
Honored Contributor III
2,572 Views

If you double-click on the .rc file, does it open the resource editor? 

 

 
0 Kudos
CHobbs1
New Contributor I
2,566 Views

Hey, Steve;

If I double click on it I get an error that says 'cannot find the winparam.h file' but then it allows me to edit the code.  This resource file was created with the Winteracter library.  That file is in the path for include file stuff.

0 Kudos
CHobbs1
New Contributor I
2,563 Views

Whoops, if I do the custom build option and put rc -ic:\path to rc file on the input and put same directory in the output section of the custom build with a *.res on the file, then this all works.

0 Kudos
Steve_Lionel
Honored Contributor III
2,539 Views

You shouldn't have to do that. 

The winparam.h thing is an issue I have seen before, and I never did figure out the cause. For some odd reason, in some installs, the resource compiler (rc) isn't seeing the paths to the Windows SDK include files. When I have had this problem, not for a while now, I edited the file to include the full path to winparam.h.

 

0 Kudos
CHobbs1
New Contributor I
2,524 Views

Steve, the problem here I think is that VS2019 is not even trying to evoke rc.exe to compile the resource file because it thinks it is another type of file.  The installation of this Winteracter library should have happened before I installed VS2019 and Intel Fortran.  So, even though the computer thinks VS2019 is the default program for *.rc files, clicking on the *.rc file in the solution explorer of VS2019 shows in properties that it thinks the file type is Winteracter resource.

Any ideas on how I might convince VS2019 to invoke the rc program to compile the *.rc file without a custom build?  Short of uninstalling VS2019 and fortran and reinstalling them, I'm at a loss.  

As always, your advice is appreciated.

0 Kudos
Steve_Lionel
Honored Contributor III
2,516 Views

Click on the Windows Start button and type regedit - when the Registry Editor shows up in the list, click to open it.

Expand HKEY_CLASSES_ROOT and click on .rc (you'll have to scroll down a lot.) Is the Content Type text/plain? I have seen issues where installing other tools changes this to something else, and VS won't recognize it.

What usually fixes this is to delete the .rc entry (click on .rc and press Delete), then run a "repair" on Visual Studio.

 
 
0 Kudos
CHobbs1
New Contributor I
2,509 Views

I think you are onto something.  It refuses to delete, but that may be a privileges thing.  Attached is the pic showing the Winteracter.resource thing.  Pretty sure that is the route of my problem coming from me improperly installing the library.

 

I believe this is the solution and I just need to make it happen.  Thank you, Steve.

0 Kudos
Steve_Lionel
Honored Contributor III
2,499 Views

Yes, that is very likely the problem. Start over with the search, and this time when regedit comes up, select "Run as administrator". Now you'll be able to delete the entry and can do the "repair" of the VS install.

 
0 Kudos
CHobbs1
New Contributor I
2,494 Views

That did it, Steve!  I am where I need to be.  Thank you!

Reply