Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CHobbs1
Novice
137 Views

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

Jump to solution

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

Accepted Solutions
Steve_Lionel
Black Belt Retired Employee
68 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

9 Replies
Steve_Lionel
Black Belt Retired Employee
125 Views

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

 

 
CHobbs1
Novice
119 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.

Tags (2)
CHobbs1
Novice
116 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.

Steve_Lionel
Black Belt Retired Employee
92 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.

 

CHobbs1
Novice
77 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.

Steve_Lionel
Black Belt Retired Employee
69 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

CHobbs1
Novice
62 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.

Steve_Lionel
Black Belt Retired Employee
52 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.

 
CHobbs1
Novice
47 Views

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